Dynamic filtering

When using the feature to show Power BI reports in your system, it is often necessary to automatically apply a filter to the data when opening the report.

This feature is called dynamic filtering and is available in Power Embedded.

1. How to configure dynamic filtering

To configure dynamic filtering, go to the Datasetsarrow-up-right page.

Search for the dataset you want to configure dynamic filtering for, click the Actions button, and select the Dynamic filtering (API) option.

This is the dynamic filtering configuration screen:

On the dynamic filtering screen, you will need to configure 3 parameters:

  • Property name in the API call: This is the name of the property that will be used to pass the value to be filtered in the API call. This property name can be defined by you, and must be used in the API call.\

  • Parameter name in the model: This is the name of the table and column that will be filtered in your report. The format of this field must follow the table/column pattern and is case sensitive, meaning there is a difference between uppercase and lowercase, and it must match exactly what is in Power BI.\

  • Operator: Which comparison operator should be used to filter the data. In the vast majority of cases, the operator will be "=".

2. How to use dynamic filtering

To use dynamic filtering, you will use the customFilters parameter in the JSON of the API call.

Example JSON request with CustomFilters and 2 parameters:

API call response:

When embedding this URL in your system, the user will be directed to this URL:

https://demo.powerembedded.com.br/Organization/4b532635-a0c6-48ae-bea8-a5197c63f057/Report/a91ff398-849d-40bd-b40a-e40229f273eb?filter=dLojas/FD_LOJA eq 5 and dFuncionarios/FD_FUNCIONARIO eq 12

When opening the report, we can observe that the data has been filtered correctly:

3. Notes on dynamic filtering

  • The columns to be filtered must be listed in the report's Filters panel.

  • The table and column name is case sensitive, meaning there is a difference between uppercase and lowercase. The name must exactly match what is in the model.

  • Table and Field names are case sensitive, but values are not.

  • Hidden fields in the report view can still be filtered.

  • Avoid using accents and spaces in the column or table name.

  • For more information, refer to this Microsoft documentationarrow-up-right.

Atualizado