Forum Discussion

klaritak's avatar
klaritak
Frequent Visitor
4 years ago
Solved

Cumulative count on two different dates columns

Below is my data:  ID Date Created Date Cancelled 1 01.01.2022   2 01.02.2022   3 15.02.2022   4 01.03.2022   5 03.03.2022   6 27.03.2022   7 01.04.2022   ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi klaritak ,

    Please refer to my pbix file to see if it helps you.

    Create measures.

    Cumulative count on date 27.03 =
    VAR _max_id =
        CALCULATE (
            MAX ( 'Table'[ID] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Date Created] = DATE ( 2022, 3, 27 ) )
        )
    RETURN
        CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER ( ALL ( 'Table' ), 'Table'[ID] <= _max_id )
        )
    
    Cancelled =
    VAR _created =
        CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
    VAR caleled =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER ( ALL ( 'Table' ), 'Table'[Date Cancelled] <> BLANK () )
        )
    RETURN
        _created - caleled
    

    If I have misunderstood your meaning, please provide the details. Why did you want to calculate Cumulative count on date 2022.03.27.

     

    Best Regards

    Community Support Team _ Polly

     

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