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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
third_hicana
Helper IV
Helper IV

Format Background Color by Comparing Values in One Column

Hello. I woud appreaciate your help regarding my scenario. I was not able to get the right solution.

I want to compare the 'Value' per 'Money" type if the value of projects (ID Level 2) exceeds to its associated BOP in ID Level 1 column. If value of projects per money type exceeds the value of BOP per 'Money" type, font color is red. If it does not exceed make it color black.

 

In my example data below totals per Money" type of projects BOP23-016-B and BOP23-016-B exceeds the CAPEX, OPEX and TOTAL of ID BOP23-016. Total Capex of projects is 70 which exceeded 8 of BOP Capex. The same principle applies to OPEX and TOTAL.

While BOP25-003-B project values for CAPEX, OPEX and TOTAL is below to the values of BOP BOP25-003.

ID Level 1ID Level 2MoneyValueTagging
BOP23-016 TOTAL67.21BOP
BOP23-016 CAPEX8.00BOP
BOP23-016 OPEX59.21BOP
BOP23-016BOP23-016-BTOTAL91.00Project
BOP23-016BOP23-016-BCAPEX25.00Project
BOP23-016BOP23-016-BOPEX66.00Project
BOP23-016BOP23-016-CTOTAL137.00Project
BOP23-016BOP23-016-CCAPEX45.00Project
BOP23-016BOP23-016-COPEX92.00Project
BOP25-003 TOTAL180.00BOP
BOP25-003 CAPEX80.00BOP
BOP25-003 OPEX100.00BOP
BOP25-003BOP25-003-BTOTAL40.00Project
BOP25-003BOP25-003-BCAPEX20.00Project
BOP25-003BOP25-003-BOPEX20.00Project
     
     

 

Screenshot of Sample Data

third_hicana_0-1727167799540.png

 

 

Appreciate your help. Thank you.

 

 

1 ACCEPTED SOLUTION
BIswajit_Das
Super User
Super User

Hello @third_hicana 
You can create a measure as per your conditions
Step1 - Need to figure the [Value] where the [Tagging] IN {"BOP"} as per [ID Level 1] & [Money]

Step2 - Need the sum of [Value] for the [Tagging] IN {"Project"} as per [ID Level 1] & [Money]
Step3 - Add the condition Step2 > Step1 then Return "RED" else "BLACK"
Here's the complete DAX
task4.png

 

Thanks & Regards...

View solution in original post

4 REPLIES 4
BIswajit_Das
Super User
Super User

Hello @third_hicana 
You can create a measure as per your conditions
Step1 - Need to figure the [Value] where the [Tagging] IN {"BOP"} as per [ID Level 1] & [Money]

Step2 - Need the sum of [Value] for the [Tagging] IN {"Project"} as per [ID Level 1] & [Money]
Step3 - Add the condition Step2 > Step1 then Return "RED" else "BLACK"
Here's the complete DAX
task4.png

 

Thanks & Regards...

@BIswajit_Das 

Superb. Thank you very much for your help 🙂 

BIswajit_Das
Super User
Super User

Hello @third_hicana 
Is your result table gonna be something like this ?
task3.png

Thanks & Regards...

Hi @BIswajit_Das 

Yes.

 

May I know how did you do this in DAX?

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors