Forum Discussion
JGiesy349
2 years agoNew Member
Help with a running count by category
Hi, I have the following data, Type and Result. I'd like to create a running count of each instance of "Type", starting anew with a new Type, such as in my column "Desired Running Count". I've tr...
- 2 years ago
JGiesy349 , You can create a measure for this
Desired Running Count =
VAR CurrentType = Data[Type]
VAR CurrentRow = EARLIER(Data)
RETURN
COUNTROWS(
FILTER(
Data,
Data[Type] = CurrentType &&
Data[Index] <= CurrentRow[Index]
)
)
bhanu_gautam
Super User
2 years agoJGiesy349 , You can create a measure for this
Desired Running Count =
VAR CurrentType = Data[Type]
VAR CurrentRow = EARLIER(Data)
RETURN
COUNTROWS(
FILTER(
Data,
Data[Type] = CurrentType &&
Data[Index] <= CurrentRow[Index]
)
)
- JGiesy3492 years agoNew Member
Thank you very much bhanu_gautam !
I modified it slightly to get it to work, but it did.
Desired Running Count =VAR CurrentType = Data[Type]RETURNCOUNTROWS(FILTER(Data,Data[Type] = CurrentType &&Data[Index] <= EARLIER(Data[Index])))