Power Query filters based on UserID

I have a sales dashboard built with Power Query, Power Pivot, Power View and Power Maps that I need to filter based on the user that opens the dashboard. Users in ABCD territory, should see sales data for ABCD sales, but should not see sales from ZYXW territory.
We do this all the time in SSRS using User!UserID as a parameter passed into a stored procedure, but I am not familiar with what function within Power Query would pass the user ID as a parameter into the stored procedure.
Any help would be greatly appreciated.

I have solved this limitation by automatically producing one file per user on the dashbord. This also reduce the amount of data per user so the response is fast.
In the database MS SQL there are a number of "temporary" tables which are sources to the Power Pivot
database. Those tables are loaded with subsets of data per user and the database is refresh and published
on the dashbord (Power View). The tables are loaded by stored procedures with the users ID as parameter. Programmed with VBA. No SharePoint in this case.
Gosta Munktell

Similar Messages

  • Filtering a Power Query Table Based on a Column That's a Table

    I have a table produced by an outer join ... 
    "Bananas" is not one of [My Fruit] values.  I'd like to filter my join results to only include [My Fruit] values, and I thought I could do that without expanding "NewCol".
    Am I mistaken in my belief that such a selection can be done without expanding the "NewCol"?

    hi Mark Weisman,
    I suppose your [My Fruit] value is single values. You can try below :
     Table.SelectRows( Join1,  each  List.Contains( [NewCol] [Fruit] , [My Fruit] ) )
    Note: [Fruit] is the column that contain value want to filter.
    Below is my testing sample :
    let
        Source = Table.FromRows({ {"North", "Apples"}, {"North", "Orange"}, {"West", "Bananas"},{"West", "Lemon"}}, {"Region", "Fruit"}),
        Group = Table.Group(Source, {"Region"}, {{"NewCol", each _, type table}}),
        Select = Table.SelectRows( Group, each List.Contains( [NewCol] [Fruit] , "Lemon" ) )
    in
        Select
    Regards,

  • Blank Record Appearing in Power Pivot, How do I ensure that my Power Query script is filtering out all the Blank Records

    Hi,
    I noticed once of my Fact tables in my Power Pivot model contains a blank record. I can't understand why.
    So I added a Filter expression to the underlying Power Query query, something like; -
    Text.Length("MyField") > 0
    However after refreshing the Power Query query which contains the above expression the blank record still appears within my Power Pivot table.
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    hi..
    As my understand, the blank record in Power Query will be return null value . So that, You try to use Text.Length("MyField" ) <> null.
    Regards,

  • How to use power query with sitecatalyst

    Hello,
    I need to use power query to import a table from sitecatalyst. Doing some tests I found that If remove the session from the url that has the report parameters, the app will redirect me to the login page, after entering the company, username and password
    it will load the report page with the data according to my filters.
    When I add the report url on the From Web option, excel does not allow me to add credentials. If I add the login+redirect url it allows me to add user/password but does not load the tables that appear on a regular browser.
    Is it possible to consume sitecatalyst without using Report Builder? If not, how you access the security info after you added the url.
    Thanks.

    To the best of my ability to tell, the right way to use this product from within Power Query would be to use its API. Unfortunately, we don't currently support either of the methods needed to be able to authenticate with the service (OAuth 2.0 and a relatively-custom
    digest-based method). Adding a mechanism to allow use of arbitrary OAuth-protected resources is a fairly high priority for us, and I hope we'll be able to deliver something before mid-2015.
    Scraping the website is very hard to do well -- both from an authentication and from a data discovery perspective.

  • How to use Power Query to load data from a single source into multiple tables

    Hi all,
    I have a requirement to load my data into three different data models using Power Query. Is that possible?
    My source is a SharePoint survey list, with similar questions like:
    1) Course lecturer - John Doe
    1a) The course was useful (rate 1 to 5)
    1b) The lecturer displayed good knowledge of topic (rate 1 to 5)
    2) Course Lecturer - Mary Brown
    2a) The course was useful (rate 1 to 5)
    2b) The lecturer displayed good knowledge of topic (rate 1 to 5)
    I would like to split the data into separate data models (one for John Doe; another for Mary Brown), so that I can compare the different lecturers. Other than running separate surveys for each of them, I thought of using Power Query to transform the data.
    Is it possible?
    Thanks.
    Regards
    GM

    Yes, this is possible.
    Start with a single query that returns you the data for all lecturers.
    Right-click on the "all lecturers" query in the queries pane, and choose Reference, once for each lecturer. This will create a query for each lecturer.
    Open the query for each lecturer and filter the data so that only that lecturer's results are visible.
    Click "Close & Load To..." for each lecturer's query  to load the data into the data model. This will create a data model table for each lecturer.
    If your question is more about how to transform such a survey list into a table that can be easily filtered, please provide an example of how the list shows up in Power Query.
    Ehren

  • Power Query; How do I reference a Power Pivot table from a Power Query query

    Hi,
    It's pretty awesome how you can define Extract Transform and Load processes within Power Query without having to type in a single line of code. However how do I reference a Power Pivot table from a Power Query query to avoid me repeatedly accessing
    the same data source (CSV) file with a view to increasing performance?
    We are aware of the reference sub menu option with Power Query. However the new query created by the "reference" option still seems to refresh data from the data source (CSV) rather than just referencing the base query. Is this understanding
    correct? There does seem to be a lot of hard disk activity when re-running the new query which is based on a base query rather than a data source.  So we were hoping the new query would just need to reference the base query in memory rather than rescanning
    the hard disk. Is there any way to ensure that the reference query just rescans the base query in memory?
    Kind Regards,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Hi Kieran,
    This sounds like something to be suggested for a future release. At the present time, Power Query will always re-run the entire Power Query query when refreshed. The Reference feature is analogous to a SQL view whereby the underlying query is always re-executed
    when it's queried, or in this case refreshed. Even something like using the Power Query cache to minimise the amount of data re-read from the disk would be helpful for performance but the cache is only used for the preview data and stored locally.
    It would be a good idea to suggest this feature to the Power BI team via the feedback smiley face.
    Regards,
    Michael Amadi
    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
    Website: http://www.nimblelearn.com, Twitter:
    @nimblelearn
    Hi Michael, 
    Glad to hear from you about this.  And thanks to Kieran for bringing a very good valid point to debate. Will be glad to see this in future release. 
    - please mark correct answers

  • WIS 00015 error- Multiple Query Filters contain a prompt with same name

    Hi
            I am working BOXIR2 environment. I created two prompts at Universe level- one of Date field and one on agency name field.
    syntax for the prompts is
    customerInfo.RSRCE_NAME =  @Prompt('Enter value(s) for AgencyName ','A' , , ,)
    datetable.STARDATE =datetable.STARDATE.STARTDATE =  @Prompt(' 'Enter value(s) for StartDate:','D' , , ,)
    When I include even one of  the prompts in the report I am getting an error WIS 00015 Multiple Query Filters contain a prompt with the same text, but the prompts use a different operand type.
    If I try to change text of one of the prompts in Universe selection statement, then I see the prompt two times in the report.
    Please let me know how to overcome this issue.

    Ok, I've simplified the case.
    Here is the real case :
    Object filter =
    Based on object =
    .[LEVEL01]
    Object filter =
    Based on object =
    .[LEVEL01]
    In WBI query result I take these objects :
    .[LEVEL01]
    .[LEVEL01]
    .[4IUX93YJGXQEHGLX0T0GPNA9Y]
    In query filters, my 2 filters with same text :
    1.
    I run the query.
    Answer to question 'Single Year Period ?' = Period 06 2010
    ==> MDX error
    A database error occured. The database error text is: Echec de l'exécution de la requête MDX SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006] avec l'erreur Invalid MDX command with . (WIS 10901)
    And you can see that the value sent to both filters is the same and come from the first filter .[Z12010006] instead of applying the value to each filter .[Z12010006] for the first one and .[Z12010006] for the second one.
    Please, notice that if I change the order of this 2 filters in the WBI query, the MDX generated become :
    SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006]
    Thanks for your help.
    G.OM.

  • [UNSOLVED] Event Log Custom XML Query Filtering Help

    I've looked at a few different posts but I must be missing something because what I'm constructing isn't working.
    Here's the XML code of an example event:
    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    - <System>
    <Provider Name="ERAS WCF" />
    <EventID Qualifiers="0">0</EventID>
    <Level>4</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2014-07-09T20:32:51.000000000Z" />
    <EventRecordID>899070</EventRecordID>
    <Channel>Application</Channel>
    <Computer>server.f.q.d.n</Computer>
    <Security />
    </System>
    - <EventData>
    <Data>User [email protected] has submitted 'Get BIOS Information' operation from servername to computername.f.q.d.n.</Data>
    </EventData>
    </Event>
    This is my query:
    <QueryList>
    <Query Id="0">
    <Select Path="Application">*[EventData[Data and (Data='computername' or Data='ip.add.re.ss')]]</Select>
    </Query>
    </QueryList>
    I always get 0 results, even if I take stabs in the dark:
    *[System[(Level=1  or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]
    *[EventData[Data and (Data='*computername*')]]
    *[EventData[Data and (Data='%computername%')]]
    I used this post as my guide for filtering based on content: http://blogs.technet.com/b/askds/archive/2011/09/26/advanced-xml-filtering-in-the-windows-event-viewer.aspx
    Also:
    I hope this is the right place for this question.  This said to post in the server
    forums, but in
    the server forums, it said to post here.
    I happen to be doing this on a server, but it could just as easily be a desktop.

    Hello,
    Thanks for posting question to this forum. Since this forum is related with XPath, what I can do is to help you validate your XPath query. With your query, I tested them with my computer, however, all of them could load event record correctly:
    Query:*[EventData[Data and (Data='Office12AssertTimer' or Data='6.3.9600.17031')]]
    Result:
    Query:*[System[(Level=1  or Level=2 or Level=3 or Level=4 or Level=0 or Level=5)]]
    Result:
    So your XPath query is ok. Do you have a try to use the same query to filter the event log to check if there are records with another computer? I am wondering if there is something wrong with your current computer.
    And since the XPath is ok, I would like suggest you posting it to the server forum to see if there are others looking into it.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Need to install Power Query with Internet Explorer 8

    Hello, could someone please help me?
    I need to install Microsoft Power Query to allow me to easily merge excel tables from different worksheets (files).
    The problem is that I am restricted to Internet Explorer 8.
    Here are my specs, I cannot change these:
    Windows 7, 64-bit operating system
    Excel 32-bit, Professional Plus 2010
    Internet Explorer 8
    When I try to install Power Query, I get the message that I need IE 9.
    I and others have other browser-based tools that only work on IE 8.
    There must be some work-around for this.
    I do NOT require the internet-searching feature of Power Query.
    Here are some possible options?
    Go into Control Panel and manually switch IE versions each time (not a feasible method at all)
    Force Power Query to work using Chrome or FireFox instead
    Disable certain features of Power Query to allow installation with IE 8
    This is really disappointing, I don't understand why we can't just have Power Query install regardless of IE version.
    Some functions could be disabled, but at least we could still use the actually important tools.
    Thanks for your help. Any input is appreciated.

    Hi,
    As far as I know,
    Microsoft Power Query for Excel requires Internet Explorer 9 or greater. Windows operation system will check the system requirements before starting installation. Thus, we could not do the options which you mentioned above.
    Then, we may try to find the workaround to get your original purpose: Merge excel tables from different worksheets (files).
    1. Try to use
    PowerPivot
    http://www.powerpivotpro.com/2012/09/combine-multiple-worksheetsworkbooks-into-a-single-powerpivot-table/
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    2. Try to use VBA code
    http://msdn.microsoft.com/en-us/library/office/gg549168(v=office.14).aspx
    3. If you have Excel 2013, we may try the new featuer "Data Model " in Pivot table:https://support.office.com/client/Tutorial-PivotTable-data-analysis-using-a-Data-Model-in-Excel-2013-f9ad8310-3b5b-48a3-913d-5cc1b364ee46
    Hope it's helpful.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Create custom column in power query

    Hello All,
    I have a requirement to create report for the Analysis, my raw data looks like below which I'm extracting from multiple tables. I would like to extract project wise number count  based on status, my idea is to create custom columns to write the value
    if the value matches to the condition else blank. Example my status has multiple status value ( closed, on-hold,warranty,inprogress,etc) i need to know what formula will help me extract data in different columns so that i can get the count in pivot for each
    status)
    NUMBER         CATEGORY                                Internal SLA  
        EXTERNALSLA      DATE_ENTERED    STATUS
    C1000001    HEINEKEN                                    t             
                     t                  9/13/2014            CLOSED
    C1000002    Migration-BLACKROCK AppV                                                           
    2/11/2015    Terminated
    C1000004    Migration-BLACKROCK AppV                                                          
    10/24/2014    CLOSED
    C1000005    Migration-BLACKROCK AppV        t                                  t  
                  1/12/2015    On-Hold
    C1000006    Migration-BLACKROCK AppV                                                  
             11/5/2014    CLOSED
    C1000007    Migration-BLACKROCK AppV    t                                       
    t               9/12/2014    CLOSED
    C1000008    Migration-BLACKROCK AppV                                                              
    8/6/2014    On-Hold
    C1000009    BLACKROCK                                                                                      
    8/5/2014    In Progress
    C1000010    Migration-BLACKROCK AppV    t                                          t  
                  8/5/2014    On-Hold
    C1000011    Migration-BLACKROCK AppV                                                              
    10/25/2014    CLOSED
    C1000012    BLACKROCK                                                                                        
    9/24/2014    CLOSED
    C1000013    BLACKROCK                                                                                      
    10/16/2014    Terminated
    C1000015    BLACKROCK                                                                                        
    9/1/2014    In Progress

    Hi Imke,
    I have achieved what i wanted to... I did try the way you have suggested. But end result was not fruitful.
    I did following for status wise count.
    Step1: In power query I have created duplicate status column for each status available.( Example I have status {closed,open,initial... etc} I have created duplicate column for each status and replaced with null.For closed Except closed all i replaced in
    column with null).
    Step2: So every time my power query data refreshes it does that step each time so that i can get the count of each status column wise in my pivot table.
    I have attached the result,
    Harsha

  • Unable to setup Power Query automatic refresh in Power BI Sharepoint Portal as per instructions

    Followed all instructions to setup a PowerQuery connected data source for automated refresh but no luck. Keeps giving the following error message. A connection could not be made to the data source with the Name of 'TestConnection' when trying to test the
    connection.
    Here are the exhaustive steps.
    1. Created an excel file that uses power query to connect to an On Prem database
    2. Created a powerview against the resulting data set (stored in data model/powerpivot)
    3. Setup a data management gateway on O365 Power BI Admin center
    4. Installed Data Management Gateway and associated keys on the On Prem server (established connection handshake successfully)
    5. Created a data source in Power BI Admin center, specified Power Query as the data source, copied and pasted Power Query connection string from excel file, validated tested connection for data source
    6. Uploaded the report file to Power BI site
    7. Now, when trying to setup the automatic refresh, it pulls the information for the associated connections in the file correctly. However when trying to test the connection, constantly just returns with the following message
    A connection could not be made to the data source with the Name of 'TestConnection'. Correlation ID: c3d2a19b-f03d-4b14-8d5e-8fe0ed103238
    It looks like the DMG based update is still half baked. What is missing here since all of the data connection validation and handshake steps for gateway and data source works correctly. Why is it that the Powerquery based excel file is unable to leverage
    the DMG and datasource to connect and pull data?
    Any thoughts or guidance, much appreciated.

    Everything,
    Is this still an issue?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • 'Merge' function in Power Query

    A bit of background-
    I have 3 .txt files that I would like to combine into one table in Excel using Power Query. Two of the files contain the same kind of data, and the third contains geographic data I'd like to add on. The first two files I mentioned have an 'ID number' column
    that is also contained in the third file (with geographic data). My goal is to append the first two files, and then use a merge to add geographic fields to the data, matching up based on common ID numbers.
    The first file is about 10000 rows, the second is about 6000. The files are not very big, however when I try to expand the columns in the merge, it says that Excel has loaded several Gbs from the file I'm trying to merge with, when the file is only about
    16 mb.
    Anyone have any ideas how this merge could cause all this 'data' to be loaded, never allowing it to be completed?

    Hi,
    Thanks for your feedback. One way that you could approach this scenario is by importing the three files using "From File -> From Text" in Power Query, then use "Append" to get a new query that appends the first two queries, and finally do a Merge
    operation between the result of Append and the third file.
    If you are indeed doing this and still hitting the issue, you can send us more details via "send a frown" and selecting "include formulas", which will give us more information to help you debug the issue.
    Thanks,
    M.

  • Can not see new Power Query data sources?

    Hi, 
    New Power Query can connect to three new data sources: Sybase IQ, Exchange, Dynamics CRM Online
    http://office.microsoft.com/en-us/excel-help/whats-new-in-power-bi-ha104149776.aspx
    I just installed the latest Power Query and wanted to connect to CRM Online instance. For some reason I can not see these new data sources, what am I missing?
    Thanks in advance!

    Hmm... I didn't think we had quite released this version yet. It's possible that that website went live before the link to the new download. There should be a blog entry about this on the "Power BI" blog in the very near future.
    At the risk of providing a spoiler :), the CRM Online support is via OData.

  • Multiple Table.AddColumn command in a single Power Query

    I was using this example in another thread for another question and this issue popped up.
    I have this list in sharepoint.
    When I run this Power Query
    let
    Source = SharePoint.Tables("https://server/test"),
    PQtesting = Source{[Name="PQtesting"]}[Content],
    RemovedColumns = Table.RemoveColumns(PQtesting,{"ContentTypeID", "ContentType", "CreatedById", "ModifiedById", "Owshiddenversion", "Version", "Path", "Attachments"}),
    Custom1 = Table.AddColumn(RemovedColumns, "Options 2", each Text.Combine([Options][Value], ", ")),
    Custom2 = Table.AddColumn(RemovedColumns, "Options 1", each Text.Combine([Options][Value], " and "))
    in
    Custom2
    Only column Custom2 shows up in the output, if I remove custom2 then custom1 shows up.  It appears only one custom column shows up at a time as I can swap them and the custom column on the bottom will always show in the output.  I have found examples
    online of others using multiple custom columns.  Is this a limitation of something I'm doing in my code or of sharepoint, or am I doing something wrong?
    Thanks in advance,
    Eric

    I'm a bit embarrassed on how long I have been trying to figure this out.
    Thank you so much for your help.
    Eric

  • Visual studio online - Excel power query usage and samples needed

    Background
    Visual Studio Online does not offer much in the way of reporting, when compared to (onsite) TFS... unless you utilize the REST API functionality.
    The Visual Studio Online REST API is fairly extensive, but not very 'reporting' friendly to applications like Microsoft Excel.
    Question
    Are there any good examples of Microsoft Excel Power Query usage - to acquire and create reports via the Visual Studio Online REST API?  I've searched - but surprisingly haven't found anything of substance.  It is fairly simple to call a VSO REST
    query using Excel Power Query, but not so simple to iterate through the lists within lists, etc... unless you are familiar with 'M language'.

    Hi,
    Thank you for reaching out to us. I am currently researching to gather more information with regards to your request. I shall revert back to you with an update at the earliest. Sincerely appreciate your patience.
    Regards,
    Nithin Rathnakar

Maybe you are looking for