Forum Discussion
During Power BI Export, How to Reset Default Report Filters Before Applying reportLevelFilters ?
- 5 months ago
Hi Nahid_SJ,
Yes, the method you described using report.bookmarksManager.capture() is a widely used workaround in Power BI Embedded scenarios.
By capturing the report state with:
report.bookmarksManager.capture()
you save the entire current state of the report, including slicers, filters, and visual settings. This captured state can then be used as defaultBookmark in the Export API request, ensuring the export uses the bookmark state you specify instead of the current session filters.
There are several benefits compared to using reportLevelFilters:
It keeps the full report state (slicers, visual filters, page filters, etc.), not just report-level filters.
It prevents conflicts where existing filters combine with reportLevelFilters.
It is effective in dynamic Embedded scenarios, allowing users to adjust slicers and filters during runtime.
The process is:
Capture the current report state with report.bookmarksManager.capture().
Use the captured state as defaultBookmark in the ExportToFile API request.
Export the report with that state.
This approach makes sure the exported file matches the desired state, without needing to clear or restore filters manually. Using captured bookmarks for export state control is a reliable way to manage Power BI Embedded reports with user-modifiable settings.
Thank you.
Hi Nahid_SJ,
As we did not get a response, may I know if the above reply could clarify your issue, or could you please help confirm if we may help you with anything else?
Your understanding and patience will be appreciated.
I found and another way to solve this way, instead of using reportLevelFilters,
report.bookmarksManager.capture() I just used to capture the state and then pass into defaultBookMark and exported the report.