Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
yuvara
Frequent Visitor

Roll over the data for rest of the months

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 NumberPromised Delivery DateActual Delivery Date
Order 12-Oct-222-Nov-22
Order 22-Sep-221-Sep-22
Order 32-Sep-22 

 

And the desired result is as follows:

OrderAugSepOctNovDec
Order 1   LATE 
Order 2 ON TIME   
Order 3 LATELATELATELATE

 

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

2 ACCEPTED SOLUTIONS

Hi CST, 

 

Thanks for the solution, it almost statisfies 90% of the scenarios. Just one sceniro it missed out is the past date

yuvara_0-1669284094332.png

the result looks like :

yuvara_1-1669284167593.png

Order 4 - should be Late from March to September as well. Working on tweaking your DAX, but its really helpful.

 

View solution in original post

yuvara
Frequent Visitor

So, I tweaked your DAX as below:

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(MAX ( 'Table'[Promised Delivery Date] )) && month(MAX ( 'Calendar'[Date] ))  <=  month(MAX ( 'Table'[Actual Delivery Date] )), [Tag]),
        IF ( MONTH ( MAX ( 'Calendar'[Date] ) ) >= MONTH ( _month ), [Tag] )
    )
 
yuvara_2-1669286237303.png

 

View solution in original post

5 REPLIES 5
v-easonf-msft
Community Support
Community Support

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] )
    )

veasonfmsft_0-1669277476685.png

 

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

yuvara_0-1669284094332.png

the result looks like :

yuvara_1-1669284167593.png

Order 4 - should be Late from March to September as well. Working on tweaking your DAX, but its really helpful.

 

yuvara
Frequent Visitor

So, I tweaked your DAX as below:

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(MAX ( 'Table'[Promised Delivery Date] )) && month(MAX ( 'Calendar'[Date] ))  <=  month(MAX ( 'Table'[Actual Delivery Date] )), [Tag]),
        IF ( MONTH ( MAX ( 'Calendar'[Date] ) ) >= MONTH ( _month ), [Tag] )
    )
 
yuvara_2-1669286237303.png

 

FreemanZ
Super User
Super User

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. "

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors