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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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