Forum Discussion

Nahid_SJ's avatar
Nahid_SJ
New Member
5 months ago
Solved

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 thi...
  • v-sgandrathi's avatar
    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.