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 all,
How can I create a column with rolling years for each previous 365 days. How can i do that on Power BI? last 365 as -Y1, followed by -Y2, -Y3 and it counts backwards.
Solved! Go to Solution.
Hi @MonirSikder ,
You could give something like this a go.
Just copy the script below into a new blank query.
let
Source = Table.FromColumns(
{List.Dates(#date(2021, 1, 1), 3 * 365, Duration.From(1))},
type table [Date = date]
),
AddRollingYear = Table.AddColumn( Source, "Rolling Year", each
[ n = Number.Round( -Number.From( Date.From( DateTime.FixedLocalNow()) - [Date] )/ 365, 0),
r = if n < 0 then Text.From(n) & "Y" else null
][r], type text
)
in
AddRollingYear
It's relative to today, amend to your needs.
Hi @MonirSikder ,
You could give something like this a go.
Just copy the script below into a new blank query.
let
Source = Table.FromColumns(
{List.Dates(#date(2021, 1, 1), 3 * 365, Duration.From(1))},
type table [Date = date]
),
AddRollingYear = Table.AddColumn( Source, "Rolling Year", each
[ n = Number.Round( -Number.From( Date.From( DateTime.FixedLocalNow()) - [Date] )/ 365, 0),
r = if n < 0 then Text.From(n) & "Y" else null
][r], type text
)
in
AddRollingYear
It's relative to today, amend to your needs.
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 |
|---|---|
| 11 | |
| 10 | |
| 6 | |
| 6 | |
| 5 |