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
Anonymous
Not applicable

Newbie Alert: If Statement between two number columns

Hi All

 

I was tring to add a new column with a very simple Goal - If estimated costs is less than or equal to Actual Cost  then its green ; otherwise red.

 

I know below  (Fig 1)  shows equal too however i cant get anythng working and I cant see whats wrong?

 

Appreciate any advice.

 

Jimmy

 

 

 

Cost RAG = PMO[Estimated Labour Cost - Widget Project Board] = PMO[Actual Labour Cost to Date - Widget Project Board],"Green","Amber")

 

 

Fig 1

 

jimmyg706_0-1696168002811.png

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @Anonymous,

 

try the DAX below to create a calculated column:

Cost RAG = 
IF( PMO[Estimated Labour Cost - Widget Project Board] <= PMO[Actual Labour Cost to Date - Widget Project Board],"Green","Amber" )

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@TomMartens     Would you believe me if I told you I tried this and it was not working.

And I just copied your code and it works.

 

It change it around to this but all good.

 

Cost RAG = 
IF( PMO[Estimated Labour Cost - Widget Project Board] >= PMO[Actual Labour Cost to Date - Widget Project Board],"Green","Amber" )

 

Thanks Tom. I know it was an easy peasy one.

 

 

TomMartens
Super User
Super User

Hey @Anonymous,

 

try the DAX below to create a calculated column:

Cost RAG = 
IF( PMO[Estimated Labour Cost - Widget Project Board] <= PMO[Actual Labour Cost to Date - Widget Project Board],"Green","Amber" )

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.