PowerBI: How to use TupleFilter with powerbi-client?

自古美人都是妖i 提交于 2019-12-13 20:10:48

问题


I am trying to use TupleFilter in powerbi-client, since I need to filter data based on two different columns with OR statement between them (2 different columns in the same table or may be in 2 different ones), check this question out.

As I read in this docs, tuple filter can do this.

However, when I tried to use it with report.setFilters(filters) function, I got this error from setFilters function: "undefined property is invalid".

Moreover, I didn't find the function used in the above docs in powerbi-client:

visualHost.applyJsonFilter(filter, "general", "filter", FilterAction.merge)

So, I just tried setFilters(filters).

Getting deeper in the filters docs, I found this:

Report level filter supports the following types: IBasicFilter | IAdvancedFilter | IRelativeDateFilter.

Page level filter supports the following types: IBasicFilter | IAdvancedFilter | IRelativeDateFilter.

Visual level filter supports the following types: IBasicFilter | IAdvancedFilter | IRelativeDateFilter | ITopNFilter | IIncludeExcludeFilter.

So, what I couldn't understand, how to use Tuple Filters if none of the above filter levels support it!


回答1:


Tuple filter is not supported for embedding

You read correctly, TupleFilter is not supported in any filter level. It's an API used by Power BI visuals - so it can be used to create custom slicers (such as HierarchySlicer - it may solve your issue btw). Currently however, tuple filters aren't supported for Power BI filters at all, so can't be used with powerbi-client - which deals with embedding a Power BI "element" (report, dashboard, visual etc.) inside a web page or application.

Note that tuple filter support for powerbi-client may be added in the future.


Full disclosure: I'm a Microsoft employee, working in one of Power BI's development teams. No affiliation with HierarchySlicer visual.



来源:https://stackoverflow.com/questions/59181883/powerbi-how-to-use-tuplefilter-with-powerbi-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!