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
kala2
Helper III
Helper III

Fill Dates incremental from January until ID changes

My table is in the following format: 

kala2_0-1634570118422.png


I want to add a new column with dates filled by month. When an ID changes i need to restart the date incremental from January like:

kala2_1-1634570140917.png


**When a year changes, the dates will increment by year:

kala2_0-1634571192168.png


Is it possible to achieve something like that?

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@kala2 

you can try this

Column = 
var _count=CALCULATE(COUNTROWS('Table (2)'),FILTER('Table (2)','Table (2)'[Project ID]=EARLIER('Table (2)'[Project ID])&&'Table (2)'[SAMPLE DATA]<=EARLIER('Table (2)'[SAMPLE DATA])))
return EDATE(date(2021,1,1),_count-1)

1.PNG





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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@kala2 

you can try this

Column = 
var _count=CALCULATE(COUNTROWS('Table (2)'),FILTER('Table (2)','Table (2)'[Project ID]=EARLIER('Table (2)'[Project ID])&&'Table (2)'[SAMPLE DATA]<=EARLIER('Table (2)'[SAMPLE DATA])))
return EDATE(date(2021,1,1),_count-1)

1.PNG





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

Proud to be a Super User!




Works Perfect, Thanks!

you are welcome





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

Proud to be a Super User!




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.