Forum Discussion
During Power BI Export, How to Reset Default Report Filters Before Applying reportLevelFilters ?
I'm using Power BI Embedded in a web application with an embed token, and I'm exporting reports to PDF using the Power BI Export API.
During export, I apply filters using reportLevelFilters like this:
"reportLevelFilters": [
{
"filter": "CalenderYMonth2/YearMonth in ('2025-Aug') and CalenderYMonth2/Year in (2025) and Category in ('Sample1', 'LTA')"
}
]The issue occurs when the report already has default filters or slicer selections. When exporting, the reportLevelFilters seem to be combined with the existing filters, which causes the exported result to be incorrect or unexpected. To solve this, I’m thinking of handling it from the frontend before triggering export API. My idea is when export button click:
- Get the current filters
- Remove existing filters
- Apply export-specific filters
- Export the report
- Restore the original filters
However, I'm not sure if this is the correct or possible approach.
Questions:
- What is the best way to reset or ignore existing report/slicer filters before applying reportLevelFilters for export?
- Is the frontend approach (remove → apply → export → restore) reliable/possible in Power BI Embedded scenarios?
- Is there a better pattern recommended by Microsoft for exporting with specific filters while ignoring existing report state?
Constraints:
I cannot use bookmarks, because users can edit the report inside the application, and multiple users may modify filters/slicers dynamically.
Any guidance or recommended implementation would be appreciated.
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.
5 Replies
- v-sgandrathi
Community Support
Hi Nahid_SJ,
In Power BI Embedded, when you use the ExportTo API and pass reportLevelFilters, these filters are applied in addition to the current report state, including any active slicers, report filters, or bookmark states. This means that existing filters might combine with your export filters and influence the exported output.
At this time, the Export API does not have a built-in way to automatically clear existing report or slicer filters before applying reportLevelFilters.
For Embedded scenarios, it is common to use the Power BI JavaScript API on the frontend to manage the report state. You can capture the current state, temporarily clear or reset filters (such as with report.reset() or by clearing filters programmatically), apply the export-specific filters, start the export, and then restore the original filters once the export request is made. This approach helps ensure that only the intended filters are used for the export, while the user's report experience remains unchanged.
Since your application's users can adjust slicers and filters dynamically, managing the reset process on the frontend is generally the most effective solution.
Thank you. - v-sgandrathi
Community Support
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.
- Nahid_SJNew Member
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.
- v-sgandrathi
Community Support
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.
- v-sgandrathi
Community Support
Hi Nahid_SJ,
we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.
Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!