Forum Discussion

kryer89's avatar
kryer89
New Member
1 year ago
Solved

Cumulative count

Hi,

 

i'm trying to plot a line chart with cumulative count of rows but it's not working.

 

my data is like:

IDStartDate
ID102/10/2023
ID202/04/2024

ID3

null
ID405/10/2023
ID512/01/2024
ID612/01/2024
ID715/05/2024

 

I want to plot a chart with this data

Count1246
date02/10/202305/10/202312/01/202415/05/2024

 

but I cannot figure out how to do it, I've tried with this measure

 

 

 

CALCULATE (
    COUNTROWS(  'MASTER' ),
    FILTER (
        ALL ( 'MASTER' ),
        'MASTER'[StartDate] <= MAX ( 'MASTER'[StartDate] )
    )
)

 

 

 

 but what I get is the cumulative of the cumulative, like

Count13713
date02/10/202305/10/202312/01/202415/05/2024

 

Is there any way I can fix it?

 

Thanks!

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi kryer89 ,

     

    Please try code as below.

    Measure = 
    CALCULATE (
        COUNTROWS(  'MASTER' ),
        FILTER (
            ALLSELECTED( 'MASTER' ),
            'MASTER'[StartDate] <= MAX ( 'MASTER'[StartDate] ) && MASTER[StartDate]<>BLANK()
        )
    )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi kryer89 ,

     

    Please try code as below.

    Measure = 
    CALCULATE (
        COUNTROWS(  'MASTER' ),
        FILTER (
            ALLSELECTED( 'MASTER' ),
            'MASTER'[StartDate] <= MAX ( 'MASTER'[StartDate] ) && MASTER[StartDate]<>BLANK()
        )
    )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

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