cancel
Showing results for 
Search instead for 
Did you mean: 
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
Community Champion
Community Champion

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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors