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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Bish92
Frequent Visitor

Multiple If Statements

Hi, I need help converting an Excel Formula for it to work in Powerbi... The statement is the following...

=IF([@[PROMISE_DATE]]="","On Time", IF(AND([@[COMMIT TO SHIP]]<TODAY(), [@[PROMISE_DATE]]<TODAY()),"Late", IF([@[COMMIT TO SHIP]]<=[@[PROMISE_DATE]],"On Time","Late")))

Bish92_0-1653057056583.png

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Bish92 

You can try this, change the part in the rectangle

vxiaotang_0-1653377724067.png

vxiaotang_1-1653377880169.png

On Time/Late = IF('Table'[PROMISE_DATE]=BLANK(),"On Time",IF('Table'[COMMIT TO SHIP]<TODAY() && 'Table'[PROMISE_DATE]<TODAY(),"Late", IF('Table'[COMMIT TO SHIP]<='Table'[PROMISE_DATE],"On Time","Late")))

vxiaotang_2-1653378072090.png

FYI: DAX operators - DAX | Microsoft Docs

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Bish92
Frequent Visitor

Hi All,

Thanks to everyone who responded. I have managed to fix it and get it working!

I appreciate the help.

v-xiaotang
Community Support
Community Support

Hi @Bish92 

You can try this, change the part in the rectangle

vxiaotang_0-1653377724067.png

vxiaotang_1-1653377880169.png

On Time/Late = IF('Table'[PROMISE_DATE]=BLANK(),"On Time",IF('Table'[COMMIT TO SHIP]<TODAY() && 'Table'[PROMISE_DATE]<TODAY(),"Late", IF('Table'[COMMIT TO SHIP]<='Table'[PROMISE_DATE],"On Time","Late")))

vxiaotang_2-1653378072090.png

FYI: DAX operators - DAX | Microsoft Docs

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

HotChilli
Community Champion
Community Champion

It's easier to debug an IF statement by breaking it down into separate clauses - so you can identify which part is throwing the error.

For now, let's test out the first clause by creating a test column:

IF([@[PROMISE_DATE]]="","On Time", "Late")

I think that will probably throw an error, because a date is being compared to a string, You can test a date against BLANK() instead.

Let me know how it goes

Bish92
Frequent Visitor

Hi, Thank you for replying!

The main issue i am having is..

"DAX comparison operations do not support comparing values of type Text with values of type Date. Consider using the VALUE or FORMAT function to convert one of the values."

 

 

Hello @Bish92 .

 

Please change datatype of date feilds to Date.

 

Please mark it answer if it resolves your isseue. Kudos are also appreciated.

 

Cheers,
Shishir
HotChilli
Community Champion
Community Champion

Welcome to the forum.

Are you trying to create a calculated column?

If so, what errors are problems have you received?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.