Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I've been trying to figure out something i'm sure is simple and it's taken me an embarassing amount of time!
All i want to to do generate a list of dates that increment a whole year each time (not 365 days!) when given:
1) A start date
2) An end date
3) The number of dates to produce
I thought i could do this with something like the below:
List.Dates(#date(2011, 03, 31), 10, #duration(365, 0, 0, 0))
However 365 days is different to a 'year', and all my dates must be "31/03/20XX", with the XX just incrementing by one year each time (31/03/2011, 31/03/2012, 31/03/2013 and so on)
Is there a simple way to do this?
I'll also need to produce a seperate list of the 5 earliest dates within that list too, and maybe remove dates that go beyond a certain threshold - but i'm new to M and struggling a bit so am taking baby steps!
Thanks 🙂
Thanks 🙂
Solved! Go to Solution.
You can do it like this. Start a blank query with this step. You can adjust the initial list 0..9 and/or the start date in #date( ).
= List.Transform({0..9}, each Date.AddYears(#date(2020,1,1),_))
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
You can do it like this. Start a blank query with this step. You can adjust the initial list 0..9 and/or the start date in #date( ).
= List.Transform({0..9}, each Date.AddYears(#date(2020,1,1),_))
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Excellent! Thanks 🙂
I looked at that, but it seems to be for a single year - i couldn't get it to generate a list of years.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 63 | |
| 50 | |
| 45 |