Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Running total issue

Hi all,

 

Please issue sample of my data set, My data is large data below i am showing sample

Client NameCase created datecase notype
a22/08/2019222x
a22/08/2019223x
a21/08/2019224x
b20/07/2019225y
b19/07/2019226y
b15/07/2019227y
b14/07/2019228z
c13/05/2019223z
c16/05/2019229z
c17/04/2019230z
c13/03/2019231x
c12/2/2019232x

 

I want to calcualte distinct count of client code based on cases id we received last 90 days by running total.  (last three months if we received cases from the client which means client is alive)

 

I want to represents the data like below to create visual

Total Alive clients  
 JulyAug 
X1615( cases received in last three months)
Y1714 
Z1812 

 

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Anonymous ,

    Please try to use following measure formula if it suitable for your requirement:

    Measure =
    VAR curr =
        MAX ( 'Table'[Case created date] )
    RETURN
        CALCULATE (
            COUNTA ( 'Table'[case no] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                [Case created date]
                    >= DATE ( YEAR ( curr ), MONTH ( curr ) - 3, 1 )
                    && [Case created date] <= curr
            ),
            VALUES ( 'Table'[Client Name] )
        )
    

    Regards,
    Xiaoxin Sheng

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Please try to use following measure formula if it suitable for your requirement:

    Measure =
    VAR curr =
        MAX ( 'Table'[Case created date] )
    RETURN
        CALCULATE (
            COUNTA ( 'Table'[case no] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                [Case created date]
                    >= DATE ( YEAR ( curr ), MONTH ( curr ) - 3, 1 )
                    && [Case created date] <= curr
            ),
            VALUES ( 'Table'[Client Name] )
        )
    

    Regards,
    Xiaoxin Sheng