Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JGiesy349
New 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 tried so many different ideas I think I'm missing the forest for the trees.

 

Can anyone help?

 

JGiesy349_0-1715965016156.png

 

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@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]
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
bhanu_gautam
Super User
Super User

@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]
)
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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]
RETURN
COUNTROWS(
FILTER(
Data,
Data[Type] = CurrentType &&
Data[Index] <= EARLIER(Data[Index])
)
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.