Forum Discussion
Power BI Embedded Export ignores programmatically set filters in Bookmark state
- 3 months ago
Hi DavideBono97,
Thank you for reaching out through the Microsoft Fabric Community Forum.
Based on our understanding, the export operation only respects the state serialized within the bookmark payload along with any explicitly supported export filters. Filters applied interactively through slicers or the user interface are included because they become part of the captured bookmark state. However, filters applied programmatically are treated as runtime or session filters and are not automatically persisted into an already precomputed bookmark state, unless a new bookmark is captured after those filters have been applied.
One possible approach is to first apply the filters using setFilters(), wait for the report rendering to complete by listening to the report.on("rendered") event, then dynamically capture a new bookmark state using await report.bookmarksManager.capture(), and finally pass that captured bookmark state into the Export To File request. Precomputed bookmark states should be regarded as static snapshots and might not automatically incorporate subsequent API filter changes.
Additionally, kindly refer the links below:
Export Power BI embedded analytics reports API - Power BI | Microsoft Learn
Reports - Export To File - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Enhance your users' experience with bookmarks in Power BI embedded analytics | Microsoft Learn
Use filters in a Power BI embedded analytics report | Microsoft Learn
How to handle events in a Power BI embedded analytics application | Microsoft LearnWe hope the information shared above helps resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
Hi DavideBono97,
Thank you for reaching out through the Microsoft Fabric Community Forum.
Based on our understanding, the export operation only respects the state serialized within the bookmark payload along with any explicitly supported export filters. Filters applied interactively through slicers or the user interface are included because they become part of the captured bookmark state. However, filters applied programmatically are treated as runtime or session filters and are not automatically persisted into an already precomputed bookmark state, unless a new bookmark is captured after those filters have been applied.
One possible approach is to first apply the filters using setFilters(), wait for the report rendering to complete by listening to the report.on("rendered") event, then dynamically capture a new bookmark state using await report.bookmarksManager.capture(), and finally pass that captured bookmark state into the Export To File request. Precomputed bookmark states should be regarded as static snapshots and might not automatically incorporate subsequent API filter changes.
Additionally, kindly refer the links below:
Export Power BI embedded analytics reports API - Power BI | Microsoft Learn
Reports - Export To File - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Enhance your users' experience with bookmarks in Power BI embedded analytics | Microsoft Learn
Use filters in a Power BI embedded analytics report | Microsoft Learn
How to handle events in a Power BI embedded analytics application | Microsoft Learn
We hope the information shared above helps resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.