Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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:
=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:
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
Solved! Go to Solution.
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]
)
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!
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 13 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 19 | |
| 11 | |
| 10 |