Forum Discussion
Slicer based on multiple columns
- 5 years ago
Hi aileenkaz ,
I think you can create three measures, and when the filter results of three slicers are met at the same time, the corresponding values will be displayed.
M_filter6 = var a = SELECTEDVALUE(DATA[Filter6]) return IF(MAX('Filter'[Value Code])=a,1,0) M_filter7 = var a = SELECTEDVALUE(DATA[Filter7]) return IF(MAX('Filter'[Value Code])=a,1,0) M_filter8 = var a = SELECTEDVALUE(DATA[Filter8]) return IF(MAX('Filter'[Value Code])=a,1,0)
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, v-henryk-mstf, thank you very much for your answer!
Yes, you are right. I want to filter the rows in the DATA table by using specific columns in the Filer table as filters. But in the first step I want to choose which filter column I want to use, because only one filter should be used at a time (e.g. If I have selected value 1 for filter 6, I cannot select any other value in any other filter).
I am thinking about how to design it in such a way it does not take so much space. That's why I wanted to use hierarchical filter, but now I see why it would not work. Can you help me with this?
Another solution I was thinking about was to have:
- one slicer as a dropdown menu with filters to choose which column I want to filter DATA by
- another slicer to choose whether I want to filter by value 1 or 2
But this is probably too complicated, because the second slicer would have to dynamically change the column which should be filtered. Is it possible to show/hide whole slicer based on selection made in another slicer? That would simplify the problem.
Thanks for helping me.
Hi aileenkaz ,
I think you can create three measures, and when the filter results of three slicers are met at the same time, the corresponding values will be displayed.
M_filter6 =
var a = SELECTEDVALUE(DATA[Filter6])
return IF(MAX('Filter'[Value Code])=a,1,0)
M_filter7 =
var a = SELECTEDVALUE(DATA[Filter7])
return IF(MAX('Filter'[Value Code])=a,1,0)
M_filter8 =
var a = SELECTEDVALUE(DATA[Filter8])
return IF(MAX('Filter'[Value Code])=a,1,0)
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.