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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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