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
Dawn85
Frequent Visitor

Help with Excel multiple IF formula converted to DAX

Hello,

I have this formula in Excel and I need it rewritten in DAX but I am unsure how to do this. I am very very new to DAX and so far have only been able to do the basics. I hope someone can help!

Excel formula:

Excel Formula:
=IF([@[Date Shipped]]="","",IF([@[Date Exchanged]]="",[@[Date Shipped]]-[@[Date Approved]]+1,[@[Date Shipped]]-[@[Date Exchanged]]+1)-([@[Paused Days (Total)]]*([@[Paused Days (Total)]]<>"")))


My attempt was disastrous and clearly not correct:

Code:
Column = IF(ISBLANK('winnipeg erp_workorder'[Date Shipped]),BLANK(),IF(ISBLANK('winnipeg erp_workorder'[Date Exchanged]),('winnipeg erp_workorder'[Date Shipped]-'winnipeg erp_workorder'[Date Approved])+1),('winnipeg erp_workorder'[Date Shipped]-'winnipeg erp_workorder'[Date Exchanged])+1)-(IF(NOT(ISBLANK('winnipeg erp_workorder'[Paused Days Total],'winnipeg erp_workorder'[Paused Days Total]*'winnipeg erp_workorder'[Paused Days Total]))))


Thank you

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Column =
SWITCH (
    TRUE (),
    ISBLANK ( 'winnipeg erp_workorder'[Date Shipped] )BLANK (),
    ISBLANK ( 'winnipeg erp_workorder'[Date Exchanged] ),
        'winnipeg erp_workorder'[Date Shipped] - 'winnipeg erp_workorder'[Date Approved] + 1,
    'winnipeg erp_workorder'[Date Shipped] - 'winnipeg erp_workorder'[Date Exchanged] + 1 - 'winnipeg erp_workorder'[Paused Days Total]
)

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

By the way, the formatting is courtesy of www.daxformatter.com - a free service that helps you understand your own DAX code better - I use it all the time.

I am brand new to DAX so I have a lot to learn, any tool is greatly appreciated, Thank you!

lbendlin
Super User
Super User

Column =
SWITCH (
    TRUE (),
    ISBLANK ( 'winnipeg erp_workorder'[Date Shipped] )BLANK (),
    ISBLANK ( 'winnipeg erp_workorder'[Date Exchanged] ),
        'winnipeg erp_workorder'[Date Shipped] - 'winnipeg erp_workorder'[Date Approved] + 1,
    'winnipeg erp_workorder'[Date Shipped] - 'winnipeg erp_workorder'[Date Exchanged] + 1 - 'winnipeg erp_workorder'[Paused Days Total]
)

Perfect! This is exactly what I was looking for, Thank you very much!

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.