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.
I have an interesting issue to deal with. I am working on the On Time Delivery Report, and the requirement is, if the order is Delivered then the OTD is difference between closed date and promised Ship date. But if the order is Not yet delivered and Promised Ship Date is greater than today, then the salesorder should be tagged as late for the current and rest of the months, till the order is closed/Delivered.
For Example :
Order Number | Promised Delivery Date | Actual Delivery Date |
Order 1 | 2-Oct-22 | 2-Nov-22 |
Order 2 | 2-Sep-22 | 1-Sep-22 |
Order 3 | 2-Sep-22 |
And the desired result is as follows:
Order | Aug | Sep | Oct | Nov | Dec |
Order 1 | LATE | ||||
Order 2 | ON TIME | ||||
Order 3 | LATE | LATE | LATE | LATE |
I think the formulae for Order 1 and 2 is simple, but for order 3 - I am not sure how to accomplish it. Any help would be really appreciated
Thanks
Yuvaraj
Solved! Go to Solution.
Hi CST,
Thanks for the solution, it almost statisfies 90% of the scenarios. Just one sceniro it missed out is the past date
the result looks like :
Order 4 - should be Late from March to September as well. Working on tweaking your DAX, but its really helpful.
So, I tweaked your DAX as below:
Hi, @yuvara
If you have a saperate calendar table, you can try measure formula like:
Tag =
IF (
MAX ( 'Table'[Actual Delivery Date] ) <> BLANK ()
&& MAX ( 'Table'[Promised Delivery Date] ) > MAX ( 'Table'[Actual Delivery Date] ),
"Ontime",
"Late"
)
Result =
VAR _month =
MAX (
MAX ( 'Table'[Actual Delivery Date] ),
MAX ( 'Table'[Promised Delivery Date] )
)
RETURN
IF (
MAX ( 'Table'[Actual Delivery Date] ) <> BLANK (),
IF ( MONTH ( MAX ( 'Calendar'[Date] ) ) = MONTH ( _month ), [Tag] ),
IF ( MONTH ( MAX ( 'Calendar'[Date] ) ) >= MONTH ( _month ), [Tag] )
)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi CST,
Thanks for the solution, it almost statisfies 90% of the scenarios. Just one sceniro it missed out is the past date
the result looks like :
Order 4 - should be Late from March to September as well. Working on tweaking your DAX, but its really helpful.
So, I tweaked your DAX as below:
don't understand this part "the requirement is, if the order is Delivered then the OTD is difference between closed date and promised Ship date. "
Sorry - "the requirement is, if the order is Delivered then the OTD is difference between Actual Delivery date and promised Ship date. "
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 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |