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
ronaldbalza2023
Continued Contributor
Continued Contributor

Conditional Formatting - Table

Hi power bi friends. Could someone help me out on this one please. So I have a table with static data (5 years & 1 year column) and with different measures (YTD column)

I wanted to have a conditional formatting with the YTD column like data bar that says if YTD column is nearing to reach the 1 year column, the color will be turned into orange, then if YTD is nearing to reach the 5 year column it will then turned into green.

 

See YTD column measures:

YTD Measure = IF (
    HASONEVALUE ( 'KPI Financial Planning'[Category] ),
    SWITCH (
        VALUES ( 'KPI Financial Planning'[Category] ),
        "$EBIT", [$EBIT Financial Planning],
	    "$Revenue", [$Revenue FP],
	    "Average Revenue/Client $", [Average Revenue/Client $],
	    "Client facing team members", [No. of Clients FP],
        "EBIT% of revenue", [EBIT% of revenue FP],       
        "Enterprise Value", [Enterprise Value FP],
        "No. of business locations", [No. of Business Locations],
        "No. of Clients", [No. of Clients FP],
        "No. of equity holders", [No. of equity holders],
        "Revenue per FTE", [Revenue per FTE FP],
        "Total FTE team", [Total FTE Team FP],
        "Turnaround Days", [Turnaround Days FP],
        0
    ))

 

ronaldbalza2023_1-1628057128750.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ronaldbalza2023 , While I am clear on you calculations. Color measure you can use .

 

example

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK("Table"[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK("Table"[Year],2014)>2018,"red","yellow"))

Color = if(FIRSTNONBLANK("Table"[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
,"lightgreen",if(FIRSTNONBLANK("Table"[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")

 

 

You can use color measure in conditional formatting using field value option

 

 

refer if needed

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ronaldbalza2023 , While I am clear on you calculations. Color measure you can use .

 

example

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK("Table"[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK("Table"[Year],2014)>2018,"red","yellow"))

Color = if(FIRSTNONBLANK("Table"[Year],2014) <=2016 && AVERAGE(Sales[Sales Amount])<170
,"lightgreen",if(FIRSTNONBLANK("Table"[Year],2014)>2018,"red","yellow"))
Color sales = if([Sales Today] -[sales yesterday]>0,"green","red")

 

 

You can use color measure in conditional formatting using field value option

 

 

refer if needed

How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.