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

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

Reply
Anonymous
Not applicable

Conditional Formatting

HI, I want to apply conditional formatting on a column in Table Visual. 
Problem Statement : I have a Balance column. I want to format it in such a way that if the value is less than 0, then the background should be Red. If the value is greater than 0, then the value should be Green. 

Thanks in advance!! 

 

1 ACCEPTED SOLUTION
hansei
Helper V
Helper V

This measure will not color balance = 0

Color = 
    var _sum = CALCULATE( SUM( Table1[Balance] ) )
    return SWITCH( true,
        _sum < 0, "Red",
        _sum > 0, "Green"
    )

Then apply to table column

hansei_0-1655816767978.png

Used this for input

Table.FromRows( { { "A", 1 }, { "A", -2 }, { "B", 3 }, { "C", 0 } }, type table [Name=text, Balance=Int64.Type] )

View solution in original post

5 REPLIES 5
speedramps
Super User
Super User

Polite reminder.

Remeber we are unpaid volunteers.

Click the thumbs up and accept as solution button. 

One question per ticket please. If you need to extend your request then please raise a new ticket.

You will get a quicker response and each volunteer solver will get the kudos they deserve. Thank you !

hansei
Helper V
Helper V

This measure will not color balance = 0

Color = 
    var _sum = CALCULATE( SUM( Table1[Balance] ) )
    return SWITCH( true,
        _sum < 0, "Red",
        _sum > 0, "Green"
    )

Then apply to table column

hansei_0-1655816767978.png

Used this for input

Table.FromRows( { { "A", 1 }, { "A", -2 }, { "B", 3 }, { "C", 0 } }, type table [Name=text, Balance=Int64.Type] )
Anonymous
Not applicable

Thank you so much for your solution. 

speedramps
Super User
Super User

Create this dax measure

 

BalanceRAG =
IF( SUM(tanlename[Balance]) >= "Green","Red")

 

Click on the Balance field in your visual right hand side fields well, conditional formating, background colour, based on Fields, Field = BalanceRAG

 

Please click thumbs up and accept as solution

 

 

 

 

Anonymous
Not applicable

Thank you so much for the solution @speedramps !!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.