cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Conditional Formatting - font color based on relative value in same table

Hi all - wondering if anyone knows how to conditionally format a column (font color) based on it's value relative to another column? Example - below, if the Actuals column is greater than the AOP column, I'd like the font color of the Actuals column to be red. If the Actuals column is less than the AOP column, I'd like it to be green.

 

ketchup_0-1607362425971.png

 

1 ACCEPTED SOLUTION
Super User IV
Super User IV

@ketchup 

 

Create a measure like:

 

Flag =
IF(
[Inv Bal Actual] > [Inv Bal AOP] , "RED", "GREEN"
)
 
Select the Actuals, Conditional Formatting and choose Field Value
 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


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

Proud to be a Super User!

Website   YouTube    LinkedIn

View solution in original post

3 REPLIES 3
Super User IV
Super User IV

@ketchup 


You do not need to use CALCULATE as you are not modifying any initial filter context.

Inv Bal Actual = SUM(Amsterdam[Inventory Balance - Actuals])

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

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

Proud to be a Super User!

Website   YouTube    LinkedIn
Super User IV
Super User IV

@ketchup 

 

Create a measure like:

 

Flag =
IF(
[Inv Bal Actual] > [Inv Bal AOP] , "RED", "GREEN"
)
 
Select the Actuals, Conditional Formatting and choose Field Value
 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


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

Proud to be a Super User!

Website   YouTube    LinkedIn

View solution in original post

Frequent Visitor

Thank you, @Fowmy! After creating [Inv Bal Actual] and [Inv Bal AOP] as measures themselves, this worked perfectly.

 

Follow up question - is there a better way to create these measures than inputting the following formula

Inv Bal Actual = CALCULATE(SUM(Amsterdam[Inventory Balance - Actuals])) ? Perhaps there is some way to transform the data before this or another way to avoid having to create lots of measures (just to be used in the Flag measure, for example).

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session Drive Data Culture with Power BI: Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors