Forum Discussion
kryer89
1 year agoNew Member
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:
| ID | StartDate |
| ID1 | 02/10/2023 |
| ID2 | 02/04/2024 |
ID3 | null |
| ID4 | 05/10/2023 |
| ID5 | 12/01/2024 |
| ID6 | 12/01/2024 |
| ID7 | 15/05/2024 |
I want to plot a chart with this data
| Count | 1 | 2 | 4 | 6 |
| date | 02/10/2023 | 05/10/2023 | 12/01/2024 | 15/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
| Count | 1 | 3 | 7 | 13 |
| date | 02/10/2023 | 05/10/2023 | 12/01/2024 | 15/05/2024 |
Is there any way I can fix it?
Thanks!
- Anonymous1 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 ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- AnonymousNot 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 ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Ashish_MathurSuper User