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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
ShrodingerBrain
New Member

Running Counts with Reset based on value of specific column.

Hi Hello,

Seeking your kind assistance.

 

(Image remove due to Data Security)

 

I want to learn how to do a Running Counts DAX that will reset the count everytime the text in column "Status" change.

1,2,3,1,2,3,1,2,3,

Been trying, and almost give up now.

Can anyone help teach me? thanks in advance.

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @ShrodingerBrain - can you use below calculated column

 

Calculated column:

RunningCount =
VAR CurrentStatus = Running[Status]
VAR CurrentDate = Running[Date]
RETURN
CALCULATE(
    COUNTROWS(Running),
    FILTER(
        Running,
        Running[Status] = CurrentStatus &&
        Running[Date] <= CurrentDate
    )
)

 

rajendraongole1_0-1722002938295.png

 

Hope it helps

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @ShrodingerBrain ,

 

@rajendraongole1 's workaround is valid.

However, his workaround is based on a sorted date column and a group column. If there's no such columns in your table, then this workaround cannot be implemented.

You can add an index column in power query editor to implement it.

vstephenmsft_0-1722222203318.png

vstephenmsft_1-1722222227614.png

Create a calculated column.

Column = SWITCH(MOD([Index],3),1,1,2,2,0,3)

vstephenmsft_2-1722222565771.png

 

You can download the attachment for details.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This should ideally be done in Power Query.  Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @ShrodingerBrain ,

 

@rajendraongole1 's workaround is valid.

However, his workaround is based on a sorted date column and a group column. If there's no such columns in your table, then this workaround cannot be implemented.

You can add an index column in power query editor to implement it.

vstephenmsft_0-1722222203318.png

vstephenmsft_1-1722222227614.png

Create a calculated column.

Column = SWITCH(MOD([Index],3),1,1,2,2,0,3)

vstephenmsft_2-1722222565771.png

 

You can download the attachment for details.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

rajendraongole1
Super User
Super User

Hi @ShrodingerBrain - can you use below calculated column

 

Calculated column:

RunningCount =
VAR CurrentStatus = Running[Status]
VAR CurrentDate = Running[Date]
RETURN
CALCULATE(
    COUNTROWS(Running),
    FILTER(
        Running,
        Running[Status] = CurrentStatus &&
        Running[Date] <= CurrentDate
    )
)

 

rajendraongole1_0-1722002938295.png

 

Hope it helps

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Kudoed Authors