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
NickHoffmans
Frequent Visitor

Separate conditional formatting on matrix subtotals and values

Hello, 
I have a matrix in which I want to apply to both the (sub)totals as well as on the values below. However, I would like to have the conditonal formatting applied separated from each other, in order to keep the (way higher) values from the (sub)totals out of the formatting of the values.

However, I don't see the possibility to have two distinct conditonal formats if I want both to be formatted in the same way (e.g., font color).

How can I make this happen?

 

Thanks!

8 REPLIES 8
mh2587
Super User
Super User

https://www.bluegranite.com/blog/controlling-conditional-formatting-using-dax follow this link for guidance 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



mh2587
Super User
Super User

Both.PNG


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



mh2587
Super User
Super User

There will be option "Apply to " in this select both the values and total option I hope this will help you


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



I am aware of the "apply to"-button. However, if click "Values and totals" it will count them together.

However, I would like to have two separate ranges (one range for "Values", one range for "Totals") to apply the different conditonal formats to.

Try to handle this with measure Just define the ranges and color codes in switch function may be this logic will resolve the issue 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



mh2587
Super User
Super User

Can you provide some details with screenshots or with something else , what you want 


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Sure.

I do have two columns (turnover and costs) which I subtract to a third column: margin

Here, I put the conditional formatting on the "values"-level of 'margin'.

NickHoffmans_0-1636632453166.png

When putting it on "totals"-level of 'margin'

NickHoffmans_1-1636632592947.png

 

I woud like to have it applied to both the values and the totals together, but separately, since the "totals" are (obviously) way higher than the "values".

Hi @NickHoffmans,

 

It seems that it can not set the total color under conditional formatting. Only the Subtotals can set the total color without rules.

vchenwuzmsft_0-1637054345007.png

You can present an idea on the power bi ideas .

 

If I am wrong, please let me know. If you can set total font dynamically, some measures like the following  maybe work.

Measure =
VAR _s =
    SUM( 'Table'[Values] )
VAR _value =
    SWITCH(
        TRUE(),
        _s < 20, "red",
        _s >= 20
            && _s < 40, "yellow",
        _s >= 40, "green"
    )
VAR _total =
    SWITCH(
        TRUE(),
        _s < 100, "Purple",
        _s >= 100
            && _s < 300, "Orange",
        _s >= 300, "blue"
    )
RETURN
    IF( HASONEVALUE( 'Table'[Values] ), _value, _total )

 

Best Regards

Community Support Team _ chenwu zhu

 

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

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