Forum Discussion
PhilippeG
1 year agoNew Member
Matrix Row Hierarchial Layers Format Options
I want to show a matrix with three different hierarchial layers. Each layer should have a different format for clarity reasons. Like this: Is this possible? As the per row-level for subtotal...
ahmedoye
1 year agoResponsive Resident
I have a potential solution here. If it works for you, kindly mark the answer so others with similar challenges can easily find this solution.
To use this solution:
- You will create a Measure to apply colors for each step in the hierarchy (Sample meaure below, replace the Table and Column properties to fit your own Model.
- Then you will apply conditional formatting on the Cell Elements section of the Matrix formatting option. (Downside is you need to apply the formatting on each of your Values Columns on the Matrix).
- Here's the sample measure you can copy to your Model:HierarchyColors =--Step1 define variables to check scope from lowest level. No need to check for the highest level.VAR LowestLevel = ISINSCOPE('Table'[Month])VAR SecondLevel = ISINSCOPE('Table'[Quarter])--Step2, write switch statement and add colors preferable using HEX codes for easy implementationVAR LogicalColors = SWITCH(TRUE(),LowestLevel, "Red", --redSecondLevel, "Orange", -- orange"Blue" --purple used for the highest level in the hierarchy)--Output the LogicalColors Variable. Then go to Format the Matrix Visual. Go to Cell Elements Sectio-- Toggle Font Color On. Then click on the FX to enable conditional formatting. Set it to Field Value, Apply to total and value. Then select this Measure and click OKRETURN LogicalColors