Skip to content

Persistent Filters

Nerya Cohen edited this page Jul 20, 2020 · 4 revisions

The persistent filters feature allows end users to retain their report state (including filters, slicers, and other data view changes). When the report is opened by the user, it's loaded with the programmed report state. The report state is shared across Power BI service, mobile, and embed scenarios.

Note: To reset the persistent filters in an embed scenario, you'll need to implement a button and use the reset persistent filters API.

Enabling persistent filters

Note: This feature is disabled by default and is supported only for embed for your organization (user owns data).

  • Verify that persistent filters is enabled in the report settings (on Power BI service or desktop).

  • Verify that your Azure Active Directory (Azure AD) app has UserStateReadWriteAll permissions.

  • Set the persistentFiltersEnabled property in the loadConfiguration settings, to true:

        var config = {
            type: 'report',
            ...
            settings: {
                persistentFiltersEnabled: true
            }
        };

The report will be loaded with the latest user's report state (if exists). The user's report state is automatically saved after 60 secondes, without any change.

Persistent filters APIs

Reset persistent filters

    /**
    * Reset user's filters, slicers, and other data view changes, to the default state of the report
    */
    resetPersistentFilters(): Promise <void>;

Save persistent filters

    /**
    * Save user's report filters, slicers, and other data view changes
    */
    savePersistentFilters(): Promise <void>;

Persistent filters applied

Note: This API can be used to determine the reset button state.

    /**
    * Returns user's filters, slicers, or other data view changes applied on the report (if exist).
    * If persistent filters is disabled, returns false.
    */
    arePersistentFiltersApplied(): Promise <boolean>;