Power BI: multiple independent filters

In general, when I select an option in a filter, the other filters will show the available values but I will not be able to select something unavailable. In this article Power BI: ignore filters between them, I explain how to make slicers not to be related with the others so I can select those unavailable options but the result is not what I want because I want the result for all selections. Let’s take an example so it will be easier to understand. I have this simple table:

power bi

And those visuals:

power bi

I want to be able to select “category = unix” and “type = sales” so if I select unix, sales are not available and vice-versa:

power bi power bi

Now I will make both filters to be ignored between each other, so if I select unix, sales are available but the score cards and the table return no values:

power bi

So how can I resolve this issue ??? Because I want the result of unix and sales together. For that, I will need to create 2 tables and 4 measures:

power bi
  • For both tables:
    DISTINCT(SELECTCOLUMNS('table',"new name",'table'[argument]))
    power bi
    power bi

  • For measure:
    var allslicers = ISFILTERED('new_table1'[argument])||ISFILTERED('new_table2'[argument])
    var slicer1 = ISFILTERED('new_table1'[argument]) && SELECTEDVALUE('table'[argument1]) IN VALUES('new_table1'[argument])
    var slicer2 = ISFILTERED('new_table2'[argument]) && SELECTEDVALUE('table'[argument2]) IN VALUES('new_table2'[argument])
    RETURN
    IF(NOT allslicers||slicer1||slicer2,1,0)
    power bi
  • For measure 2, 3 and 4:
    CALCULATE(COUNT('table'[argument1]),FILTER(VALUES('table'[argument2]),[Measure]=1))
    power bi
    power bi
    power bi

Once done:

  • For the slicers, I will replace them by my new tables
  • For the score cards, I will replace them by my measures
  • For the table, I will add “measure” in the “filters” panel only and configure like this:
    power bi

Now, if I select unix and sales, I got what I need:

power bi

Interesting Topics