Forum Discussion
Filter power BI report in webapp using reportID
I have a web app. there is a power BI report embedded in it. whenever a user runs a report, a unique reportid is generated. The datasource is a sql db. I want to show the user the data for only that particular report id for their run.
Currently the report shows all the data that's in the SQL db. the report id generated is also stored in the database. how can i put this filter on the report through SQL or power BI. It's a direct query report.
Hi Rakshana,
Thanks for the great question. What’s happening is that your embedded Power BI report is currently showing all the data, because it is not being filtered by the unique ReportID generated during a user’s run.
To solve this:
- Make sure the ReportID column is included in your Power BI report (via DirectQuery).
- In your web app, when embedding the report, pass a filter for that specific ReportID using Power BI's JavaScript API.
- (Optional but recommended) For a more secure setup, use Power BI’s Row-Level Security (RLS) and pass the ReportID as a role-based identity using the embed token.
If you want to enforce security at the dataset level, consider implementing dynamic Row-Level Security (RLS) and passing the ReportID as an identity claim in the embed token using the GenerateToken API.
Kindly refer to the below mentioned documentation links for better understanding:
Use filters in a Power BI embedded analytics report | Microsoft Learn
Using standard cloud based row-level security with embedded content in Power BI embedded analytics - Power BI | Microsoft Learn
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
Thank you for using the Microsoft Community Forum.
2 Replies
- v-kpoloju-msftCommunity Support
Hi Rakshana,
Thanks for the great question. What’s happening is that your embedded Power BI report is currently showing all the data, because it is not being filtered by the unique ReportID generated during a user’s run.
To solve this:
- Make sure the ReportID column is included in your Power BI report (via DirectQuery).
- In your web app, when embedding the report, pass a filter for that specific ReportID using Power BI's JavaScript API.
- (Optional but recommended) For a more secure setup, use Power BI’s Row-Level Security (RLS) and pass the ReportID as a role-based identity using the embed token.
If you want to enforce security at the dataset level, consider implementing dynamic Row-Level Security (RLS) and passing the ReportID as an identity claim in the embed token using the GenerateToken API.
Kindly refer to the below mentioned documentation links for better understanding:
Use filters in a Power BI embedded analytics report | Microsoft Learn
Using standard cloud based row-level security with embedded content in Power BI embedded analytics - Power BI | Microsoft Learn
Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.
Thank you for using the Microsoft Community Forum.- RakshanaFrequent Visitor
thank you so much. we passed a filter parameter in the web app. It worked