5

We are trying to hide the native filter panel of the embeded powerbi report, and create a toally new look filter panel aside the embeded powerbi report with ourselves html and js code.

The problem we have is how do we get all the options of a filter? we need to get the options of a filter so that we can populate them on custom filter panel.

I find the powerbi client js sdk as a method "getFilters" of a report, but the filter values is empty unless we check all the options on the powerbi native fitler panel manually.

How can we get any filter available options?

cuongle
  • 74,024
  • 28
  • 151
  • 206
frank
  • 1,252
  • 1
  • 12
  • 17

1 Answers1

-2

The getFilters method returns the filters currently applied to the object (can be a report or a page). That's why it will be empty if no filter is applied.

For the how to get all the options of a filter part, the short answer is such thing doesn't exist.

There are two types of filters in Power BI, Basic and Advanced. Basically, any column in any of the tables in the data model can be set as a filter target, even though it's not used in the visuals. And the filtered values can be any value compatible with the column data type. Thus, there are many, if not infinite combinations of filters.

Instead, you can check how to construct filters to set meaningful filters to the report or page. Or best, adding slicers to the report during the report building phase.

Foxan Ng
  • 6,883
  • 4
  • 34
  • 41
  • Is there a way to retrieve the list of all filters ? ( not applied and applied ? ) – Hamza Haddad Jan 27 '21 at 17:31
  • To retrieve the list of all the report-level filters, Use it like, let reportFilters = await report.getFilters(); To retrieve the list of all the page-level filters Use it like, let pageFilters= await page.getFilters(); – Parth Mangukiya Mar 16 '21 at 10:52