Forum Discussion

JGiesy349's avatar
JGiesy349
New Member
2 years ago
Solved

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...
  • bhanu_gautam's avatar
    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]
    )
    )