Forum Discussion
P_Crane31
3 years agoFrequent Visitor
DAX elapsed time calculation misbehaving?
Hello all! I have two seperate, but related questions on some strange results when I use DAX to calcualte elapsed business days from order palcement to order shipment. Both issues occur on both Des...
- 3 years ago
I think you can just use the NETWORKDAYS function, e.g.
business_days_elapsed = IF ( NOT ( ISBLANK ( elapsed_time[order_received_in_hw] ) ) && NOT ( ISBLANK ( elapsed_time[order_last_updated_at] ) ), NETWORKDAYS ( elapsed_time[order_received_in_hw], elapsed_time[order_last_updated_at] ) )You can also provide to the NETWORKDAYS function a list of dates to consider as holidays.
johnt75
3 years agoSuper User
I think you can just use the NETWORKDAYS function, e.g.
business_days_elapsed =
IF (
NOT ( ISBLANK ( elapsed_time[order_received_in_hw] ) )
&& NOT ( ISBLANK ( elapsed_time[order_last_updated_at] ) ),
NETWORKDAYS (
elapsed_time[order_received_in_hw],
elapsed_time[order_last_updated_at]
)
)
You can also provide to the NETWORKDAYS function a list of dates to consider as holidays.
P_Crane31
3 years agoFrequent Visitor
Thank you johnt75 That's super helpful. I'll need to do some research on how to implement it fully.
I'm trying to learn how to read/ write DAX (I've been using point 'n click so far). Am I reading that expression correctly:
"If elapsed_time[order_received_in_hw] is not blank AND elapsed_time[order_last_updated_at] is not blank, THEN do the Networkdays function"Thanks again!