Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |