Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
alfred1
Frequent Visitor

set hierarchy filters with API

Hi,

 

I have a problem when using the js API to set filters in a hierarchy.

 

first thing I tried was setting a basic filter with the target set as hierarchy; the filter seems to be set because the report refreshes - but the response from getFilters returns an error telling me that the filter need an operator ('In/Not').  also im not sure this will resolve the next problem i encountered:

 

second thing i tried was settings a basic filter with the column as target and using the In operator; this works, but without the ability to set basic filters to include (Blank) values it is useless for hierarchies. e.g: 

 

setting both "administrativt material och utrustning" and "byggentreprenörer" will not work because 

at level 6 we have "Utrustning" in the "administrativt material och utrustning"-branch, but in the "byggentreprenörer"-branch we have a (Blank) at that level. but unfortunetaly we cant include (Blank) in the basic filter so the whole branch will be filtered out.

 

 

Capture.PNG

 

 

using advances filters will probably not work (as far as i understand, and tested) because I need to use the In operator with multiple values. 

 

is there any plans to make us able to include blank values in basic filters? or does someone have another idea on how to solve this? 

 

i hope I was clear enough 🙂

 

 

 

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @alfred1,

 

According to the wiki/Filters, it seems hard to build a hierarchy filter. Maybe you can try the operator "All" which can bring back all the values including blanks.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Unfortunately this will not work, @v-jiascu-msft

 

thanks anyway

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.