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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi everyone!
Im trying to do a date list (in power Query), starting on a given date and then get the next 4 years.
I did this:
List.Generate(()=> [ x = 1 , y = {}] , each [x] <= 4 , each [x = [x]+1] , each Date.AddYears([Date_start] ,1) )
But Im receiving error, I dont know where is my syntax error, if anybody see it or if there is another solution I would appreciate.
thanks in advance!
Solved! Go to Solution.
ok, found it:
List.Generate( () => [ a = [Date_start], b = Date.AddYears([Date_start] ,4) ], each [a] <= [b], each [ a = Date.AddYears( [a], 1 ), b = [b] ], each [a] )
ok, found it:
List.Generate( () => [ a = [Date_start], b = Date.AddYears([Date_start] ,4) ], each [a] <= [b], each [ a = Date.AddYears( [a], 1 ), b = [b] ], each [a] )
@ctrip77 Please try this as a "Custom Column" in Power Query Editor.
=List.Numbers(Date.Year([hiredate])+1,4)
Proud to be a PBI Community Champion
Try this technique (which is good to learn for lots of other functions too)
https://exceleratorbi.com.au/build-reusable-calendar-table-power-query/
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 70 | |
| 51 | |
| 42 | |
| 29 | |
| 22 |
| User | Count |
|---|---|
| 142 | |
| 119 | |
| 56 | |
| 37 | |
| 32 |