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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
alanc
Frequent Visitor

Visual Matrix - controlling filter on another visual

Hi All - I have been struggling with filtering on matrix visual. I have two visuals, Table A visual Matrix and Table B visual. I have a heirachry as shown below on A where I only want the 3rd level (tagid) to pass that value to Table B. This is a 1:M relationship. I have tried creating measure using PATHLENGTH on Table A to get the heiarchy level and then use a Measure on B to evaluate the heirarchy on row level selected.  Not getting the desired result.

 

If any of the higher levels are selected then all the tagID's are shown in Table B which is nonsensical.  Note that the highest level is a measure that combines the values of multiple columns to get the data I want to show.  Ideally i would want to clear Visual B if the focus is set on a row anywhere in the list above level 3.

alanc_1-1705438330145.png

 

Is there a better way to approach this?  thanks for your help.

 

 

 

3 REPLIES 3
TheoC
Super User
Super User

Try the following:

 

Measure #1
SelectedLevel = 

VAR _CurrentPath = SELECTEDVALUE ( TableA[HierarchyPath] )
RETURN
PATHLENGTH ( _CurrentPath )

 

Measure #2

FilterByTagID =
VAR _SelectedTagID = SELECTEDVALUE ( TableA[tagID] )
VAR _HierarchyLevel = [SelectedLevel] 
RETURN
IF ( _HierarchyLevel = 3 && NOT ISBLANK ( _SelectedTagID ) , COUNTROWS ( FILTER ( TableB , TableB[tagID] = _SelectedTagID ) ) , BLANK() )

 

You'll need to apply the filter measure to Visual B to ensure the data in Visual B relates to the tagId selected in Visual A.  You're also going to need to use Edit Interactions from Visual A to B.

 

Obviously, you'll need to modify Measure#2 to your specific table / column names. I haven't validated syntax so may need slight modification.

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

TheoC
Super User
Super User

Hi @alanc 

 

If I am looking at the visuals correctly, Visual A has a hierarchy of LevelKeys, ItemNumber, TagID (i.e. L1, L2 and L3).  In Visual B, ItemNumber (i.e. Visual A's L2) is the L1.  If you place the ItemNumber in Visual B infront of the TagID, it may help.  

 

Please note, without seeing the model and both visual structures, I can't guarantee this will fix the problem. But hopefully it will help.

 

All the best.

 

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

alanc
Frequent Visitor

Thanks for responding but that's not the answer, Visual B is just a cut and paste of sample data not the actual (can't share it)... moving the fields around in B won't solve the problem, in all cases the tagid(s) is passed. I'm just trying to limit it.  Please see the 2nd para of my writeup.

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.