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
Anonymous
Not applicable

how to create rolling count daily overdue orders

hi bi fanz

 

i'm trying to create a table where it has rolling overdue order

 

For e.g in the excel; its able to record the no. of overdue till the order was processed

 

Excel formula "COUNTIFS(DN created on,"<"&start date,pack status,"overdue",">"&completion date)+COUNTIFS(DN created on,"<"$start date,pack status,"overdue",completion date,empty/null)"

 

 21-Aug22-Aug23-Aug24-Aug25-Aug26-Aug
 FriSatSunMonTueWed
Pick Overdue              -                  1                2              -                -                -  
Pack Overdue              -                  8              46              -                -                -  

 

in my dummy date table i have tried using the dax to get the result but it seems to return the orders created for that day 

For column

"

overdue listing = CALCULATE(
COUNTAX(OBD,OBD[Pick Status]="Overdue" ),
FILTER(OBD,OBD[Created On]='Calendar'[Date]))"
 
For measures
CALCULATE(
COUNT(OBD[Pick Status]),
Filter( ALLEXCEPT(OBD,OBD[Pick Date]),OBD[Created On]<=SELECTEDVALUE(OBD[Pick Date])))
1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, you can create a calculated table and a measure as follows.

a calculated table

overdue_new =
CALENDAR (
    MIN ( 'countofoverdue'[order date created date] ),
    MAX ( 'countofoverdue'[order completed date] )
)

a measure

countif =
VAR x1 =
    CROSSJOIN ( 'countofoverdue', 'overdue_new' )
RETURN
    COUNTX (
        FILTER (
            x1,
            [Date] >= [order date created date] + 2
                && [Date] < [order completed date]
        ),
        [Order serial]
    ) + 0

Result:

v-yuaj-msft_0-1618820516757.png

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
v-yuaj-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, you can create a calculated table and a measure as follows.

a calculated table

overdue_new =
CALENDAR (
    MIN ( 'countofoverdue'[order date created date] ),
    MAX ( 'countofoverdue'[order completed date] )
)

a measure

countif =
VAR x1 =
    CROSSJOIN ( 'countofoverdue', 'overdue_new' )
RETURN
    COUNTX (
        FILTER (
            x1,
            [Date] >= [order date created date] + 2
                && [Date] < [order completed date]
        ),
        [Order serial]
    ) + 0

Result:

v-yuaj-msft_0-1618820516757.png

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

your solution is lean and neat compared to the solution i came up with 🤣

 

amitchandak
Super User
Super User

@Anonymous , The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.


 

You can trying rolling measure with help from date tbale

Rolling 30 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-30,Day))

Anonymous
Not applicable

thanks for speedy response

 

basically; i'm trying to make the overdue orders continue to roll until the that its completed 

 

the condition is if the order is created on N date it should be completed by N+2; otherwise it will be overdue; 

Trying to make a area chart to show the trend of daily overdues 

nebiew_0-1618731431148.png

 

raw data table

nebiew_1-1618731431152.png

 

expected result table

 

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.