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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
PhilippeG
New 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:

PhilippeG_0-1736178955791.png

Is this possible? As the per row-level for subtotals does not allow to change value formatting.

 



3 REPLIES 3
PhilippeG
New Member

Somehow possible to get the headers into the same colors then values using this method?

Anonymous
Not applicable

Hi @PhilippeG 

You can only use conditional formatting for the currently expanded hierarchy.

For more information, you can refer to the following posts:
Solved: Conditional Formatting - Microsoft Fabric Community
Multiple level hierarchy matrix colors - Microsoft Fabric Community

 

Or you can use the following measure:

Measure = 
SWITCH(TRUE(),
ISINSCOPE('Table'[RowA]),"black",
ISINSCOPE('Table'[RowB]),"blue",
ISINSCOPE('Table'[RowC]),"red")

 

vjialongymsft_0-1737337910942.png


You can then click on the icon below to enter the individual matrix levels:

vjialongymsft_1-1737338027410.png

      vjialongymsft_2-1737338042103.png
     vjialongymsft_3-1737338048704.png

 

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ahmedoye
Responsive Resident
Responsive 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:

  1. 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.
  2. 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).
  3. 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 implementation
    VAR LogicalColors = SWITCH(TRUE(),
                                    LowestLevel, "Red", --red
                                    SecondLevel, "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 OK

    RETURN LogicalColors

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors