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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.