Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

v-tangjie-msft

Dynamic filtering of two tables based on one slicer

Scenario:

In this article, we'd like to achieve a scenario that distributes a table's data into two visuals for displaying while still filtering them with a single slicer.

 

The detailed requirements are: Create a report with two table visuals and one slicer visual. Two table visuals are created with the same table fields but the data that showed is different, e.g. each table visual could only display half of the data. And when we select items in the slicer, two table visuals will render the data according to the selections.

 

Expected Result :

 

When the slicer has no value selected:

vtangjiemsft_0-1710403163588.png

When the slicer has value selected:

vtangjiemsft_0-1710403237606.png

Sample Data:  

Table:

vtangjiemsft_2-1710403163591.png

 

Table2:

Create with below DAX formula:

 

 

Table 2 = VALUES('Table'[Name])

 

 

 

vtangjiemsft_1-1710403285848.png

 

How: 

1.Create a measure with below DAX formula:

 

 

Measure =
VAR tmp =
    VALUES ( 'Table 2'[Name] )
VAR cur_name =
    SELECTEDVALUE ( 'Table'[Name] )
RETURN
    IF ( cur_name IN tmp, 1 )
    ) 

 

 

2.Add two table visuals with the same table fields and add above measure to both visual's filter pane. Filter table visuals that Table1 visual only shows name with A,B,C,D and Table2 visual only shows name with E,F,G,H.

3.Add a slicer visual with Table2's Name field, cancel the interaction between two table visuals.

vtangjiemsft_2-1710403497233.pngvtangjiemsft_3-1710403502277.png

 

In this way, we can distribute a table's data into two table visuals but still filter them with a single slicer. Hope this article helps everyone with similar questions.  

 

Author: Binbin Yu

Reviewer: Ula and Kerry