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
Anonymous
Not applicable

Count for dates in date column

I thought this would be easy but I cannot for the love of anything make this work!

 

I have a date column (some blank rows, some rows with the same date sometimes). I want to create a calculated column that will count starting from the earliest date all the way to the most recent. For instances where there are multiple rows with the same date, it should have the highest count for those identical dates (so if there are two dates like 12/20/24 and 12/20/24 then both should be 2 rather than 1 then 2).  I want to use this in a line graph so that's why it's important to have that total for identicals so that line is straight between those dates showing that there hasn't been any changes.

 

Here's an example of how it should look like (did this in Excel)...

retroguy87_0-1712519331121.png

 

 

I can't wrap my head around how to do this, please help!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Dates]<=EARLIER(Data[Dates])))

Hope this helps.

Ashish_Mathur_0-1712533882159.png

 


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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

Column = CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Dates]<=EARLIER(Data[Dates])))

Hope this helps.

Ashish_Mathur_0-1712533882159.png

 


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

That worked, thank you! However, I ran into a new problem while trying to use it in a line graph. If I have 3 and 3 for the same date, then on the line graph it adds it up to 6 rather than keep it 3. I showed a screenshot below. Any ideas on how to solve that? 

retroguy87_0-1712598230399.png

 

You are welcome.  Write this measure and drag it to the line visual

Measure = min(Data[Column])

Hope this helps.


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

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.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors