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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
UvonW
Regular Visitor

Simple bidirectional filtering between bar chart and matrix not working!

Hello,

for me it assumes like a very simple problem, but I do not know, why it is not working. I want to create a bar chart and a matrix that can be filtered interactively in both directions.

I have prepared a minimum example:

this is my initial table:

IDAttribut 1.1Attribut 1.2Attribut 1.3Attribut 1.4Attribut 2.1Attribut 2.2Attribut 2.3
A1001101
B1100110
C1011100

I have two attributes wit different characteristics. Each ID either hast this characteristic ( value 1) or not (value 0)
I want to display two bar charts, one for each attribute. those bar charts schould be interactive. 
In Power Query mode i created two aditional tables by depivoting the data: 
Table 1, called "1Attribut": 

IDAttributValue
AAttribut 1.11
AAttribut 1.20
AAttribut 1.30
AAttribut 1.41
BAttribut 1.11
BAttribut 1.21
BAttribut 1.30
BAttribut 1.40
CAttribut 1.11
CAttribut 1.20
CAttribut 1.31
CAttribut 1.41

and Table 2, called "2Attribut": 

IDAttributValue
AAttribut 2.11
AAttribut 2.20
AAttribut 2.31
BAttribut 2.11
BAttribut 2.21
BAttribut 2.30
CAttribut 2.11
CAttribut 2.20
CAttribut 2.30

 

I created a relationship between the "initial table" and "1Attribute" as well as the the "initial table" and "2Attribute". In each case with the ID as a column for the relationship.
I have a cardinality of  *:1 and cross filtering "both" directions.
Know I added two bar charts. One, one for Attribut1 and one for Attribut2. Each with the Attribut value on the x-Axis and the "Value" on the y-axis. My goal is, that if i am clicking on one bar, the bars in the other diagram are filtered. Unfortunately nothing is happening if I click on a bar. 
What am I doing wrong?

I already checked the "Edit Interactions". This is set up correctly. It seems like the direction is only unidirectional (I added a table with the IDs from my initial table and if i click on a value (A,B, or C) the bar charts are filtered correctly)

Thanks for your help

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

Ok see if this works for you. Duplicate the single table and set up th emodel as follows.

 

Duplicate this tableDuplicate this table

model.png

 

Now create two measure to act as filters for each corresponding table:

Filter Person T1 =
COUNTROWS (
    CALCULATETABLE (
        VALUES ( 'Dim ID'[dID] ),
        FILTER ( 'Table 2', SUM ( 'Table 2'[Wert] ) <> 0 )
    )
)
Filter Person T2 =
COUNTROWS (
    CALCULATETABLE (
        VALUES ( 'Dim ID'[dID] ),
        FILTER ( 'Table 1', SUM ( 'Table 1'[Wert] ) <> 0 )
    )
)

 

Add the ID column from the ID dimenion table and set up each filter with its corresponding measure in the filter pane

filter pane.png

 

and this is the final resultAttributes.gif





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

PaulDBrown
Community Champion
Community Champion

Sure, you can download it from here:

https://1drv.ms/u/s!AhGKDZz6e4HehLh5YX_pYCRVmymY3A?e=0vhNxM 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

9 REPLIES 9
PaulDBrown
Community Champion
Community Champion

@UvonW 

 

Is there a particular reason why you are  setting up the model like that?

The convention would be to have a single fact table with dimension table for ID and Attribut

 

Like this:

model.pngall table.png

You can then set up your graphs eith as one or in two separate clustered column charts and just filter the attributs in each
Attributes.gif

 

Here is the link to your file with the alternative model setup:

https://1drv.ms/u/s!AhGKDZz6e4HehLh5YX_pYCRVmymY3A?e=O6cXlj 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you for your answer and also the example. Unfortunately this is not what I want to achieve. Since I want to have a filtering between the bar charts as well. 
Assume Attribut1 is "Food" and Attribut2 are "Drinks" and the ID are personas.

UvonW_0-1738833766268.png


I also want to have the opportunity to filter "How many personas that like Tomato also drink Juice"

UvonW_1-1738834114952.png

UvonW_2-1738834150367.png

 

In this case 0. And i want to achieve that by interactively clicking on the barchart. Including the table with the ID (A, B, C), i also want to see "Which persona drinks Juice?" bei clicking on Juice in the barchart.

PaulDBrown
Community Champion
Community Champion

Ok see if this works for you. Duplicate the single table and set up th emodel as follows.

 

Duplicate this tableDuplicate this table

model.png

 

Now create two measure to act as filters for each corresponding table:

Filter Person T1 =
COUNTROWS (
    CALCULATETABLE (
        VALUES ( 'Dim ID'[dID] ),
        FILTER ( 'Table 2', SUM ( 'Table 2'[Wert] ) <> 0 )
    )
)
Filter Person T2 =
COUNTROWS (
    CALCULATETABLE (
        VALUES ( 'Dim ID'[dID] ),
        FILTER ( 'Table 1', SUM ( 'Table 1'[Wert] ) <> 0 )
    )
)

 

Add the ID column from the ID dimenion table and set up each filter with its corresponding measure in the filter pane

filter pane.png

 

and this is the final resultAttributes.gif





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






This looks like exactly wha i need. Unfortunately I cam not able to rebuild your example. Could you share your .pbix example? That would be great.

PaulDBrown
Community Champion
Community Champion

Sure, you can download it from here:

https://1drv.ms/u/s!AhGKDZz6e4HehLh5YX_pYCRVmymY3A?e=0vhNxM 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you very much!!

UvonW
Regular Visitor

I created a minimal example and uploaded it on weTransfer:
weTransfer_minimalexample 

UvonW
Regular Visitor

Yes I checked that:

2Attribut

UvonW_1-1738776103208.png

and for 1Attribut

UvonW_2-1738776119627.png



Unfortunately it is in German

bhanu_gautam
Super User
Super User

@UvonW Ensure that the relationships between your tables are correctly set up. You should have a relationship between the "initial table" and "1Attribut" as well as between the "initial table" and "2Attribut" using the ID column. The relationships should be set to "Both" for cross-filter direction.

 

Verify that the interactions between the visuals are correctly set. You mentioned that you have already checked this, but it’s worth double-checking.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors