Forum Discussion
Filter two columns using the same slicer
I hope you can make me understand well.
I have the following table that annex, from which I want to get two tables based on the same slicer
A table where leader 1 is the leader (this is easy)
A table where leader one is the CoLeader.
The trick is that it is filtered with the same slicer.
I do the example in Excel but I really want the exercise with DAX
2 Replies
- OwenAugerSuper User
Hi there KatheB
If you are creating visuals in Power BI, I would actually suggest using the "Sync separate slicers" method:
https://learn.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-slicers?tabs=powerbi-desktop#sync-separate-slicersI have attached a sample PBIX to illustrate.
The steps I followed were:
- Load your table shown above (I called it Data)
- Optional: Create Lider and Co Lider dimension tables, related to the corresponding columns of Data table.
- Create the two table visuals
- Add a slicer using column Lider[Lider].
- Add a second slicer using column 'Co Lider'[Co Lider]
- Edit Interactions so that the Lider slicer just filters the first table, and the Co Lider slicer just filters the second table.
- Open the Sync Slicers pane (View > Sync Slicers).
- For each of the two slicers, select it, then in the Sync Slicers pane under "Advanced options" enter a name (I used "LiderSlicers") and leave the two boxes ticked (picture below).
- Hide the Co Lider slicer.
- Now, the filter on the Lider slicer will effectively filter Lider for the first table and Co Lider for the second table.
It is possible to use a DAX-based approach, but I consider this solution a bit tidier. Will this work for you?
If you are creating visuals in another tool based on a Power BI dataset, you may need a DAX-based approach.
- Syndicate_AdminAdministrator
Thank you! Worked! However, I still need to be able to do it with DAX, more exactly with some formula of contains.