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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tom_pbi
Regular Visitor

Count Help

Hi all,

 

I am having an issue getting the correct formula using COUNT. My scenario is that I have a column of dates and I want another column that counts the occurence of the same date cummulatively but distinctly for different dates. Example below:

Tom_pbi_0-1661350137887.png

I think the measure I have written so far would just confuse things but I am using COUNT and FILTER. Any help would be much appreciated.

 

Thanks,

Tom

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Tom_pbi ,

 

Please add the Index column in Power Query Editor.

 

vkkfmsft_0-1661758183053.png

 

Then create the column or measure.

 

Column = COUNTROWS(FILTER('Table','Table'[Date] = EARLIER('Table'[Date]) && 'Table'[Index] <= EARLIER('Table'[Index])))
Measure = COUNTROWS(FILTER(ALLSELECTED('Table'),'Table'[Date] = MAX('Table'[Date]) && 'Table'[Index] <= MAX('Table'[Index])))

vkkfmsft_1-1661758436810.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

7 REPLIES 7
v-kkf-msft
Community Support
Community Support

Hi @Tom_pbi ,

 

Please add the Index column in Power Query Editor.

 

vkkfmsft_0-1661758183053.png

 

Then create the column or measure.

 

Column = COUNTROWS(FILTER('Table','Table'[Date] = EARLIER('Table'[Date]) && 'Table'[Index] <= EARLIER('Table'[Index])))
Measure = COUNTROWS(FILTER(ALLSELECTED('Table'),'Table'[Date] = MAX('Table'[Date]) && 'Table'[Index] <= MAX('Table'[Index])))

vkkfmsft_1-1661758436810.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you! This worked perfectly. I originally solved it using this method (https://www.youtube.com/watch?v=-3KFZaYImEY&t=47s) but I prefer this easier cleaner solution.

Tom_pbi
Regular Visitor

Bumping this if anyone would be able to give some advice. Thanks!

Syk
Resident Rockstar
Resident Rockstar

You should be able to get this by summing your occurence field (value in screenshot). The first table is the sample you provided and the table on the right is just telling the value field to display as a sum. 

Syk_0-1661350680242.png

 

You can also do this with count but it will basically just count the # of times a date appears with a value.

 

Tom_pbi
Regular Visitor

Thanks but I think maybe I wasn't clear. The value field in your above screenshot is what I want to get, I don't need a sum of those values. 

Syk
Resident Rockstar
Resident Rockstar

Ah! You provided an example of what you're trying to achieve.. Can you send an example of your current data? You mention there are a column of dates, you're just trying to count them in succession?

Tom_pbi
Regular Visitor

I'm not sure how to copy and paste data in here but it is exactly as the screenshot I provided. I have a list of dates and I want to count them as shown in the image - cummulativley for each successive occurence of the same date. But starting from 1 in the case of each new date.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.