cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
srikanthgunnam
Helper I
Helper I

Passing Parameters to a Paginated Report from Power BI Report

Hello

 

I have a report built in Power BI with some filters. When the user apply few filters and click print button, those filters selected on the Power BI report should be passed as a Parameters to Paginated Report through URL. Is it possible to do so? Can someone help me with this?

1 REPLY 1
d_gosbell
Super User
Super User

Yes this is possible. First you have to create a measure that will generate the URL, then you can link this to a button. When you create the measure you may need to think about issues such as what happens when a user picks multiple values and SSRS only expects 1 or what happens when a user does not pick a value from a slicer (maybe you want to set a default value)

 

In the following measure I am using SELECTEDVALUE to pull a category from a slicer and if nothing is selected or more than one category is selected the value will default to -1 and I'm getting the min and max dates from a between date slicer and formatting them appropriately for passing on a url.

Report URL = 
var _category = SELECTEDVALUE(Category[CategoryID],-1)
var _dateFrom = FORMAT(MIN('Date'[Date]),"yyyy-MM-dd")
var _dateTo = FORMAT(MAX('Date'[Date]), "yyyy-MM-dd")
return "http://localhost/ReportServer?/Test/ParameterTest&rs:Command=Render&pCategory=" & _category & "&pDateFrom=" & _dateFrom & "&pDateTo=" & _dateTo

Then in your button set the action type to "Web URL", click on the 3 vertical dots above the WebURL text box and  choose the conditional formatting option and then select the measure you just created. In the example above I'm opening a report on my local server called ParameterTest that is sitting in a folder called Test.

 

The above url format works for on-premise reports, if you are using Power BI Premium reports in the cloud you would use a url format like the one in this blog post https://powerbi.microsoft.com/en-us/blog/url-parameters-for-paginated-reports-are-now-available/

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!