Forum Discussion
Anonymous
6 years agoNot applicable
Cumulative count measure
I looking to creating a cumulative measure on the patient count. Patient Count column is count(table[patienid])
- 6 years ago
Hi Anonymous
Try this one:
RunningTotal1 = VAR __year = MAX(TrendingTable[Date_Start_Statusdate].[Year]) RETURN CALCULATE( count(TrendingTable[vw_AccrualsList.patientId]), FILTER(allselected(TrendingTable), TrendingTable[Date_Start_Statusdate] <= MAX(TrendingTable[Date_Start_Statusdate]),values(TrendingTable(Year)) ) )
Anonymous
6 years agoNot applicable
This what i have done so far
RunningTotal1 =
VAR __year = MAX(TrendingTable[Date_Start_Statusdate].[Year])
RETURN
CALCULATE(
count(TrendingTable[vw_AccrualsList.patientId]),
FILTER(allselected(TrendingTable), TrendingTable[Date_Start_Statusdate] <= MAX(TrendingTable[Date_Start_Statusdate])
)
)gives me
The problem is after December 2018 it has to rest and in January 2019 it has to start from 99 and cumulative and so on.
How do I make it rest after the end of every year?
v-diye-msft
Community Support
6 years agoHi Anonymous
Try this one:
RunningTotal1 =
VAR __year = MAX(TrendingTable[Date_Start_Statusdate].[Year])
RETURN
CALCULATE(
count(TrendingTable[vw_AccrualsList.patientId]),
FILTER(allselected(TrendingTable), TrendingTable[Date_Start_Statusdate] <= MAX(TrendingTable[Date_Start_Statusdate]),values(TrendingTable(Year))
)
)