Forum Discussion

xChristine7714's avatar
xChristine7714
Regular Visitor
6 years ago
Solved

User Passing Parameters to a Report

I'm trying to build a report where the table containing the data is supplied by the user.

The use case is that, a user will upload a delimited file into a UI. The UI ingests the file and places the data into its own SQL database table. It then offers up a link to a PowerBI report which displays statistics related to the data in the file. Every time a file is uploaded, it's assigned a GUID and a new table is created wtih that GUID.

So, User1 might upload a file into dbo.myTable_3c1c029e06fa4083a69f8e9e3a671b8e. User2 might then upload a file into dbo.myTable_f3c2a3f7c144410b9a059ef242de9a1e. I need to create a Power BI report that can pull from either table.

The Approach I Used: I created a Power BI report with a parameter called "myTable." The report's query is tied to that parameter:

 

let
    Source = Sql.Database("myserver.blahblah.whatever", "MyDatabase", [Query="select * from " & MyTable])
in
    Source

 

So my question is, how can the user pass the MyTable parameter into the report so that the data is pulled from the correct table? I was assuming I could just give the user a link like mysite.powerbi.com/........&myTable=myTablef3c2a3f7c144410b9a059ef242de9a1e, which contains a querystring parameter that specifies the name of the table from which to get the data.

Unfortunately this isn't working. The report just ignores that querystring parameter... both in cloud and on-prem environments. So, my question is "what am I doing wrong?" And, if my approach isn't supported, what's the best way to achieve this goal? Surely there is a way to pass in report parameters...

6 Replies

  • I'm trying to build a report where the table containing the data is supplied by the user.

    The use case is that, a user will upload a delimited file into a UI. The UI ingests the file and places the data into its own SQL database table. It then offers up a link to a PowerBI report which displays statistics related to the data in the file. Every time a file is uploaded, it's assigned a GUID and a new table is created wtih that GUID.

    So, User1 might upload a file into dbo.myTable_3c1c029e06fa4083a69f8e9e3a671b8e. User2 might then upload a file into dbo.myTable_f3c2a3f7c144410b9a059ef242de9a1e. I need to create a Power BI report that can pull from either table.

    The Approach I Used: I created a Power BI report with a parameter called "myTable." The report's query is tied to that parameter:

     

    let
        Source = Sql.Database("myserver.blahblah.whatever", "MyDatabase", [Query="select * from " & MyTable])
    in
        Source

     

    So my question is, how can the user pass the MyTable parameter into the report so that the data is pulled from the correct table? I was assuming I could just give the user a link like mysite.powerbi.com/........&myTable=myTablef3c2a3f7c144410b9a059ef242de9a1e, which contains a querystring parameter that specifies the name of the table from which to get the data.

    Unfortunately this isn't working. The report just ignores that querystring parameter... both in cloud and on-prem environments. So, my question is "what am I doing wrong?" And, if my approach isn't supported, what's the best way to achieve this goal? Surely there is a way to pass in report parameters...