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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
PoweredOut
Resolver I
Resolver I

Year.From Calculation

Hi

 

I hope you can help.

 

I am trying to create a dynamic date table. Part of it is defining a start and end year. To have a dynamic start and end year I am trying this code, which gets me the date, but I want to extract the year only. 

 

This code gets me the date. 

FromYear = Date.AddYears(Date.From(DateTime.LocalNow()), -3),

 

I think I have to use the Year.From function, but I have tried a few varicances, but I don't get the result I want.

 

Can you experst help?

 

Thanks

Joe

 

1 ACCEPTED SOLUTION
PoweredOut
Resolver I
Resolver I

its always the way after posting. I have my solution 

DateTo = Date.Year(DateTime.LocalNow()) +6

 

View solution in original post

1 REPLY 1
PoweredOut
Resolver I
Resolver I

its always the way after posting. I have my solution 

DateTo = Date.Year(DateTime.LocalNow()) +6

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.