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 by comparing yesterday value

Hello All, 

 

I have 2 measures that shows today total and yesterday total. 

 

My aim is to compare yesterday total to the today total , and highlight the today value in red or green depending on if it is higher or lower than the yesterday. 

 

I know conditional formatting feature on values in table or matrix but is it possible to compare with other column's actual value?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

On the diff of two, you can use color formatting.

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting

Or you can create a color measure and use that after choosing  "field" in conditional formatting

Color = if([Sales Today] -[sales yesterday]>0,"green","red")

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...

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

5 REPLIES 5
amitchandak
Super User
Super User

On the diff of two, you can use color formatting.

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting

Or you can create a color measure and use that after choosing  "field" in conditional formatting

Color = if([Sales Today] -[sales yesterday]>0,"green","red")

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...

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
jstorm
Resolver III
Resolver III

It's difficult to see, but in the formatting section of the visualizations pane, if you hover over one of the data color fields, you will get 3 dots to the right. Click the 3 dots to access conditional formatting.

 

https://docs.microsoft.com/en-us/power-bi/visuals/service-tips-and-tricks-for-color-formatting

camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Have you tried creating another measure comparing them and formatting it by this new one ?

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

I have not tried that.. I am actually looking for directins on how to create this measure and how to use it to change color ? 

You can make a measure similar to

IF( [yesterday total] > [today total],

    1,

    0

)

 

Then in the conditional formatting area of data colors, you can use this measure as a rule.

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.

Top Solution Authors