Forum Discussion
filtering table based on dynamic slicer
Hi,
I have a table like this :
ID A flag B flag C flag D flag
1 1 1 0 1
2 0 1 0 0
3 0 1 1 1
4 1 0 1 0
5 1 0 0 0
and a slicer looks like this (slicer values are text) :
☒ A
☐ B
☐ C
☐ D
If I select A from the slicer, I would like to filter and show only the rows where A flag = 1
How do I do that ?
Thanks
Ilky
3 Replies
- amitchandakSuper User
Anonymous , One way is you unpivot this data and then use flag as slicer filer and value 1,0 as filter clause
countrows(filter(Table, Table[Value]=1))
https://radacad.com/pivot-and-unpivot-with-power-bi
Another option would be Bookmarks, 4 buttons for A,B, C,D
And use filter and column based on that https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
- AnonymousNot applicable
Hi amitchandak
The slicer dynamicly controls the values displayed in the other visuals as well.
So I cannot have it as bookmarks. All I want is to filter the table under the graph based on the category selected. The table has flags to say which row belongs to which categories. Am I clear of what I am after ?
- amitchandakSuper User
Anonymous , I think unpivot is the best option you can use
https://radacad.com/pivot-and-unpivot-with-power-bi
or may have some direct query table and see if this can work
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/