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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mysasai
Frequent Visitor

Dynamic Filtering of Two tables based on One slicer, multiple selected values

Hi all,

 

I have a situation and I'm assuming it is not possible with straight forward functionalities of PBI. 

 

Please help me in solving this. 

 

I have a data source, something like below. 

mysasai_0-1669284210108.png

 

And there are two table Visuals and a slicer present on the canvas. like below. Table 1 is filtered to show only A,B,C,D using filters on this visual. Similarly, Table2 for E,F,G,H.

 

mysasai_0-1669283752271.png

Now, the question is when I select any slicer value: for example A & B are selected the table B goes blank like below.

 

mysasai_1-1669283902272.png

Is there any way to control the interation where when A, B are selected it should not impact Table2. and vice versa, E, F are selected it should not show Table1 as blank.

 

Thanks in Advance.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mysasai ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1669963115904.png

Table2:

create with below dax formula:

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

vbinbinyumsft_1-1669963137561.png

3. create measure with below dax formula

Measure2 =
VAR _str =
    IF ( ISFILTERED ( 'Table 2'[Name] ), CONCATENATEX ( 'Table 2', [Name],, "" ) )
VAR tmp = {
    "A",
    "B",
    "C",
    "D",
    "ABCD",
    "ABD",
    "ABC",
    "ACD",
    "BCD",
    "AB",
    "AC",
    "AD",
    "BD",
    "BC",
    "CD"
}
VAR _name =
    SELECTEDVALUE ( 'Table'[Name] )
RETURN
    SWITCH (
        TRUE (),
        _str IN tmp, IF ( CONTAINSSTRING ( _str, _name ), 1 ),
        NOT ( _str IN tmp ), 1
    )
Measure3 =
VAR _str =
    IF ( ISFILTERED ( 'Table 2'[Name] ), CONCATENATEX ( 'Table 2', [Name],, "" ) )
VAR tmp = {
    "E",
    "F",
    "G",
    "H",
    "EFGH",
    "EFG",
    "EFH",
    "EGH",
    "FGH",
    "EF",
    "EG",
    "EH",
    "FG",
    "FH",
    "GH"
}
VAR _name =
    SELECTEDVALUE ( 'Table'[Name] )
RETURN
    SWITCH (
        TRUE (),
        _str IN tmp, IF ( CONTAINSSTRING ( _str, _name ), 1 ),
        NOT ( _str IN tmp ), 1
    )

3. add two table visual with Table fields and add above measure to both visual filter pane, add aslicer visual with Table2 field, cancel the interaction between two table visual 

Animation20.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it

more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @mysasai ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1669963115904.png

Table2:

create with below dax formula:

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

vbinbinyumsft_1-1669963137561.png

3. create measure with below dax formula

Measure2 =
VAR _str =
    IF ( ISFILTERED ( 'Table 2'[Name] ), CONCATENATEX ( 'Table 2', [Name],, "" ) )
VAR tmp = {
    "A",
    "B",
    "C",
    "D",
    "ABCD",
    "ABD",
    "ABC",
    "ACD",
    "BCD",
    "AB",
    "AC",
    "AD",
    "BD",
    "BC",
    "CD"
}
VAR _name =
    SELECTEDVALUE ( 'Table'[Name] )
RETURN
    SWITCH (
        TRUE (),
        _str IN tmp, IF ( CONTAINSSTRING ( _str, _name ), 1 ),
        NOT ( _str IN tmp ), 1
    )
Measure3 =
VAR _str =
    IF ( ISFILTERED ( 'Table 2'[Name] ), CONCATENATEX ( 'Table 2', [Name],, "" ) )
VAR tmp = {
    "E",
    "F",
    "G",
    "H",
    "EFGH",
    "EFG",
    "EFH",
    "EGH",
    "FGH",
    "EF",
    "EG",
    "EH",
    "FG",
    "FH",
    "GH"
}
VAR _name =
    SELECTEDVALUE ( 'Table'[Name] )
RETURN
    SWITCH (
        TRUE (),
        _str IN tmp, IF ( CONTAINSSTRING ( _str, _name ), 1 ),
        NOT ( _str IN tmp ), 1
    )

3. add two table visual with Table fields and add above measure to both visual filter pane, add aslicer visual with Table2 field, cancel the interaction between two table visual 

Animation20.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it

more quickly.

@Anonymous , thanks for the solution. This works perfectly. 

amitchandak
Super User
Super User

@mysasai , Stop interaction between the visuals

How Interactions Work- Split Page using interactions to compare - https://youtu.be/GIfRKzhMaR4

 

or use Independent Table

 

Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.