Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculate Overdue Between Dates

Hello,

 

I'm a new DAX user, can you please help. I'm trying to plot a dashboard that analyses data provide monthly cut off report: Total submit request in month, total close request in month and overdue request by end of each month. For the below table, reporting by end of Feb, total submit in FEb= 5, Total close in Feb = 2, Total overdue = 2 as at 28/2.  I don't know how to calculate the Total Overdue, can you please help?

 

Request NoSubmit DateCommitted Response DateResponse DateOpen/Close
11/2/2114/2/2114/2/21Close
22/2/2115/2/2117/2/21Close
32/2/2115/2/213/3/21Close
44/2/2116/2/21 Open
522/2/2115/3/21 Open
  • Anonymous , it should be 3/2 or 28 by two ,

     

    To get 28 means day of max selected date

     

    Try measures

    Days = Day(maxx(allselected('Date'), 'Date'[Date]))

     

    Total  = Distinctcount(Table[Request No]) // Or //count(Table[Request No])

    or

     

    Total  =calculated( count(Table[Request No]), allselected())

     

    closed =calculated( count(Table[Request No]), Filter(Table, Table[Open/Close] = "Close"))

4 Replies

  • Anonymous , it should be 3/2 or 28 by two ,

     

    To get 28 means day of max selected date

     

    Try measures

    Days = Day(maxx(allselected('Date'), 'Date'[Date]))

     

    Total  = Distinctcount(Table[Request No]) // Or //count(Table[Request No])

    or

     

    Total  =calculated( count(Table[Request No]), allselected())

     

    closed =calculated( count(Table[Request No]), Filter(Table, Table[Open/Close] = "Close"))

  • Anonymous's avatar
    Anonymous
    Not applicable

    amitchandak Thank you. However the closed measure gives me the total closed, not the closed request in the reporting period. For instance my table in the question, if reporting at 28/2/21, only 2 (request 1 & 2) are closed. Request 3 was not closed until sometime in March. 

     

    To clarify, I have a dataset for requests from October 2020 to date. I want to analyses the data, to see in each month, how many TOTAL REQUEST were raised (by count of request submitted in month), Total Closed (by count of those closed in the Month, regardless of on time or overdue), and Total overdue request by Month (count of request committed to response in the month, but still outstanding + plus any request in previous month that is still outstanding).

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Community Support

    Hi, Anonymous ;

    You could create a measure as follows:

    total submit = CALCULATE(COUNT('Table'[Request No]),FILTER(ALL('Table'),EOMONTH([Submit Date],0)=EOMONTH(MAX('Table'[Submit Date]),0)))
    Total close = 
    CALCULATE (
        COUNT ( 'Table'[Request No] ),
        FILTER (
            ALL ( 'Table' ),
            EOMONTH ( [Submit Date], 0 ) = EOMONTH ( MAX ( 'Table'[Submit Date] ), 0 )
                && EOMONTH ( [Response Date], 0 ) = EOMONTH ( MAX ( 'Table'[Submit Date] ), 0 )
                && [Open/Close] = "Close"
        )
    )
    Total overdue = CALCULATE(COUNT('Table'[Request No]),FILTER(ALL('Table'),EOMONTH([Submit Date],0)<=EOMONTH(MAX('Table'[Submit Date]),0)&&[Open/Close]="Open"))

    The final output is shown below:

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.