Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Is there a better way to approach this? thanks for your help.
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
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
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.
User | Count |
---|---|
59 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
78 | |
62 | |
45 | |
40 | |
39 |