Forum Discussion
Change hierarchy level in matrix visualization
- Anonymous4 years ago
Hi Anonymous ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure = VAR _value = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), 'Table'[City] = SELECTEDVALUE ( 'Table'[City] ) && 'Table'[Label] = SELECTEDVALUE ( 'Table'[Label] ) ) ) VAR _NIKE = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), 'Table'[Label] = SELECTEDVALUE ( 'Table'[Label] ) && 'Table'[City] = SELECTEDVALUE ( 'Table'[City] ) ) ) VAR result = IF ( HASONEVALUE ( 'Table'[City] ) && MAX ( 'Table'[Company] ) = "NIKE", _NIKE, IF ( HASONEVALUE ( 'Table'[City] ) && MAX ( 'Table'[Company] ) = "Adidas", _NIKE, SELECTEDVALUE ( 'Table'[Value] ) ) ) VAR _a = CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( ALL ( 'Table' ), 'Table'[Label] = SELECTEDVALUE ( 'Table'[Label] ) && 'Table'[Company] = SELECTEDVALUE ( 'Table'[Company] ) ) ) RETURN IF ( HASONEVALUE ( 'Table'[City] ), result, _a )If I have misunderstood your meaning, please provide more details with your desired output.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous well should explain the logic based on sample data. as I asked, will the same happen for adidas?
- Anonymous4 years agoNot applicable
Hi parry2k
Sorry, I didn't understand your question the first time (English is not my mother language).
Yes, for Adidas would the same, the total for adidas and then the cities would have the same result as it's the sum of both again (here a pic of the result)
I hope I explained it properly now.
Thank you very much 🙂