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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
third_hicana
Helper IV
Helper IV

Conditional Formatting of Font Color - Inconsistent Application in Drill Up & Down

HI Everyone,

 

Asking for your help. 

 

I have a matrix with multiple columns in the 'Columns' field (ie. budget type and money type)
Then I put a conditional formatting for font of color of values (£), red for positives and black for zeros or negatives under 'Variance' budget type. It works well when it is drilled down by 'BOP ID & Title' level.

 

third_hicana_0-1726067502250.png

 

However, if the matrix is drilled up at 'Lead Business Area' level, the conditional formatting of font color doesn't work. The negatives are also in color red as you can see below.

 

third_hicana_1-1726067617613.png

I am using a calculated column for the conditional formatting of font color below

Font Color =
SWITCH(
    TRUE(),
        consolidated[budget_type] = "Variance" && consolidated[money_type] = "CAPEX"  && [Round Consolidated Value] > 0.00, "Red",
        consolidated[budget_type] = "Variance" && consolidated[money_type] = "OPEX"  && [Round Consolidated Value] > 0.00, "Red",
        consolidated[budget_type] = "Variance" && consolidated[money_type] = "TOTAL"  && [Round Consolidated Value] > 0.00, "Red",
"Black"
         )


How can I apply the conditional formatting of font color when its is drilled up the same as when it is drilled down at ''BOP ID & Title' level.




Thank you in advance

 

-Third

2 ACCEPTED SOLUTIONS
third_hicana
Helper IV
Helper IV

 

Here's the sample data. I wasn't able to upload the sample pbix file. I can't also share a one Drive link due to security reasons. Do you know how can I upload it here?


third_hicana_0-1726131043975.png

I also tried to replicate the matrix visual and it worked. But I am not sure why the conditional formatting does not work given I used the same DAX for the calculate column.

third_hicana_1-1726131208209.png

 

 

View solution in original post

Anonymous
Not applicable

Hi @third_hicana ,

 

Have you solved the problem?

Please try using a measure instead of a calculated column if the problem persists.

Sample:

vxiaocliumsft_0-1727158857609.png

vxiaocliumsft_1-1727158976106.png

vxiaocliumsft_2-1727158996971.png

vxiaocliumsft_3-1727159032641.png

Measure = SWITCH(TRUE(),MAX('consolidated'[budget type])="Variance" && SUM(consolidated[Value])>0,"Red","Black")
 
Best Regards,
Wearsky

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @third_hicana ,

 

Have you solved the problem?

Please try using a measure instead of a calculated column if the problem persists.

Sample:

vxiaocliumsft_0-1727158857609.png

vxiaocliumsft_1-1727158976106.png

vxiaocliumsft_2-1727158996971.png

vxiaocliumsft_3-1727159032641.png

Measure = SWITCH(TRUE(),MAX('consolidated'[budget type])="Variance" && SUM(consolidated[Value])>0,"Red","Black")
 
Best Regards,
Wearsky
third_hicana
Helper IV
Helper IV

 

Here's the sample data. I wasn't able to upload the sample pbix file. I can't also share a one Drive link due to security reasons. Do you know how can I upload it here?


third_hicana_0-1726131043975.png

I also tried to replicate the matrix visual and it worked. But I am not sure why the conditional formatting does not work given I used the same DAX for the calculate column.

third_hicana_1-1726131208209.png

 

 

suparnababu8
Super User
Super User

Hi @third_hicana 

 

Try with this measure.

FontColor = 
SWITCH(TRUE(),
        MAX(consolidated[budget_type]) = "Variance" && MAX(consolidated[money_type]) = "CAPEX" && [Round Consolidated Value] > 0, "Red",
        MAX(consolidated[budget_type]) = "Variance" && MAX(consolidated[money_type]) = "OPEX" && [Round Consolidated Value] > 0, "Red",
        MAX(consolidated[budget_type]) = "Variance" && MAX(consolidated[money_type]) = "TOTAL" && [Round Consolidated Value] > 0, "Red",
    "Black")

Thanks!

Ritaf1983
Super User
Super User

Hi @third_hicana 

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.