Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago

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

  • 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-slicers

     

    I have attached a sample PBIX to illustrate.

    The steps I followed were:

    1. Load your table shown above (I called it Data)
    2. Optional: Create Lider and Co Lider dimension tables, related to the corresponding columns of Data table.
    3. Create the two table visuals
    4. Add a slicer using column Lider[Lider].
    5. Add a second slicer using column 'Co Lider'[Co Lider]
    6. Edit Interactions so that the Lider slicer just filters the first table, and the Co Lider slicer just filters the second table.
    7. Open the Sync Slicers pane (View > Sync Slicers).
    8. 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).
    9. Hide the Co Lider slicer.
    10. 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.

     

     

     

     

  • Thank you! Worked! However, I still need to be able to do it with DAX, more exactly with some formula of contains.