Skip to main content
Microsoft Idea

Power BI

Needs Votes

Finish implementing filters in embedded, e.g. topN

Vote (1) Share
Daniel Earwicker's profile image

Daniel Earwicker on 16 Jul 2019 22:52:37

When embedding a visual, we can change its filters with setFilters, as described in the docs:

https://github.com/Microsoft/PowerBI-JavaScript/wiki/Filters

But for several kinds of filter this does not work, and this limitation is also noted on that page, e.g. "[ITopNFilter below is currently not supported]"

The problem is, when we call setFilter it replaces the existing filters. Some filters are absolutely necessary for the report's functionality. They must not be removed. So to set an additional filter of a supported type (e.g. a simple date range) we must call getFilter to retrieve existing filters, then append our extra filter, then call setFilter.

But if one of the existing filters is a topN, the API refuses to accept it!

Therefore if a visual intrinsically uses such a filter, then it is impossible to set additional filters - even of the supported types.

In short, in many use cases, setFilter is broken.