Forum Discussion
Filter passed by URL not respected when exporting Power BI report to pdf
We have a report that receives a Record ID via a URL and the Record ID is then used to filter all pages.
Although we realize that per the article: Export reports from Power BI to pdf
"URL filters aren't currently respected when you choose Current Values for your export..."
We're hoping someone may have found a work-around.
Since it's just a record ID, is there an easy way for the user to "copy and paste it" so it's then considered a "changed filter value"
Just editing and re-entering doesn't seem to work - seems like the URL that includes the filter may be part of the problem.
Thanks in advance for your coaching!
- I would suggest having the filter that could be entered might be the way to get it working going forward.
Hi JDBOS ,
As mentioned in the article, the URL filters is not supported when exporting to PDF currently. Also, based on my research, I have found other considerations that URL filters are supported in some embedding scenarios and not in others:
- Embedding a report in a secure portal or website is supported.
- URL filters are supported in Power BI Embedded.
- Query string filtering doesn't work with Publish to web or Export to PDF.
- Embed with report web part in SharePoint Online doesn't support URL filters.
- Teams doesn't allow specifying a URL.
So if you want to use filter to export, maybe you could filter in the report in advance then export to pdf instead of using URL filters.
For more information about URL filter, please refer the microsoft document that could hope to help you: URL filters
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
13 Replies
- Kyle14Frequent Visitor
Found a work around for this that I've recently implemented in one of my reports.
The query string parameter filter I'm using is to filter a report based on [client name] and I only need one client selected for a report print out. I added the following measure:
Client Filter = IF(HASONEVALUE(Data[Client Name]),SELECTEDVALUE(Data[Client Name])=FIRSTNONBLANK(Data[Client Name],1),0). I added a slicer on the page with [client name] in the field well. I then added the created Client Filter measure to the slicer visual filter. Applied the filter for Client Filter is not 0. I updated the slicer to single selection (I'm using the chiclet slicer visual and chose force selection option). Then the trick is to have the filter exposed and layered behind another visual, that will be hidden to the user and non-actionable. Then sync the slicer to the rest of the pages in the report (mine has 20+ because its a deliverable to the client) and this will keep the applied Client Filter on the slicer and those can be hidden on the rest of the pages. But, the slicer needs to be visible on the first page, just blended into the canvas background or layered behind other visuals so the user doesn't know.
- BerryBIA
Advocate I
are you saying that you completed these steps and your export PDF/PPTX held the filters shown in the slicer, which is the same "client" as shown in the Query String filter ?
- Kyle14Frequent Visitor
Correct. I have a "landing page" for the users to select the client and query string URL will be attached to the coverage data (insurance) we have on them. The user can click on the coverage link and be directed to the coverage report filtered for the selected client. Export using the steps I outlined above holds the filter selection. Screenshots below.
Landing page
filter coming from query string parameter
filter on hidden slicer visual. The filter on this visual for "is not 0" manufactures a single select
Screenshot of export to PPT
- GilbertQ
Super User
Hi there, as far as I am currently aware there is no way to respect the export to PDF.
With that being said there is the capability to copy a visual as an image
https://powerbi.microsoft.com/en-us/blog/announcing-copy-a-visual-as-an-image/- JDBOS
Helper III
GilbertQ thanks for the coaching - unfortunately, this is for a nonprofit reporting on activity and outcome metrics so each page of the report has several viz, but we could certainly do "screenshots" and paste them in to a doc.
We're also exploring having another filter that could be entered based on the value in the passed record but we're trying to avoid re-entering info.
- GilbertQ
Super User
I would suggest having the filter that could be entered might be the way to get it working going forward.
- v-yingjl
Community Support
Hi JDBOS ,
As mentioned in the article, the URL filters is not supported when exporting to PDF currently. Also, based on my research, I have found other considerations that URL filters are supported in some embedding scenarios and not in others:
- Embedding a report in a secure portal or website is supported.
- URL filters are supported in Power BI Embedded.
- Query string filtering doesn't work with Publish to web or Export to PDF.
- Embed with report web part in SharePoint Online doesn't support URL filters.
- Teams doesn't allow specifying a URL.
So if you want to use filter to export, maybe you could filter in the report in advance then export to pdf instead of using URL filters.
For more information about URL filter, please refer the microsoft document that could hope to help you: URL filters
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- JDBOS
Helper III
As an update on our successful progress 🎆 , here's a screenshot.
Since we're not using embedded scenarios, the red box shows the Filter for Record ID that was passed by URL but was not able to be passed to a PDF.
So, we added an additional "Filter on all Pages" for the "Service Plan Name" field.
Since it's unique for records of this Service Plan record type, PBI Svc displays a single record to select.
When selected, this results in the same tables as the Filter by the Record ID passed by the URL.
An extra step but relatively easy since it's just clicking a single filter box.
The next challenge is that another Service Plan record type is not unique, so we may need to create a unique key that will allow us to access fields in all of the dataset's tables that are required for this multi-page report... Sounds like I may be posting another question 😊
Thanks to v-yingjl and GilbertQ for their coaching!
- GilbertQ
Super User
Awesome thanks for showing us how you solved it!
- TarRobNew Member
Have you found that this has stopped working? Yesterday this was working as per the solution detailed here but no longer.
Report opens up pre filtered, they confirm the selection and then export the to PDF, the PDF comes out unfiltered!
Yet, if they go to the report without the filtering in the URL and filter it in the report, it PDF's fine.
Pre filtering with URL so user only needs to select the one option of projectID. Filters no longer persist like this. Anyone elses experencing this?