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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
jimmyg706
Helper IV
Helper IV

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 @jimmyg706,

 

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
jimmyg706
Helper IV
Helper IV

@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 @jimmyg706,

 

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.