This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi
I am using the following and it is working well. How can I get dynamically: "today-3 years" and "today + end of next year".
For example today is 2024-Oct-29.
today-4 years is 2020-Oct-29
today + end of next year is 2025-Dec-31
Thanks
let
Today = Date.From(DateTime.LocalNow()),
TodayFormatted = Date.ToText(Today, "dd.MM.yyyy"),
TomorrowFormatted = Date.ToText(Date.AddDays(Today, 1), "dd.MM.yyyy")
in
TomorrowFormatted
Solved! Go to Solution.
= Date.FromText( Text.From( Date.Year(Date.AddYears( Date.From(DateTime.LocalNow()),1))) & "-12-31")
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
You can add year to specific date by Date.AddYear and also calculate the last date of a year by Date. EndOfYear.
So your dates can be achieved by the below formual.
Today date => Date.from(DateRime.LocalNow())
Date of next three year=> Date.AddYear(Date.from(DateRime.LocalNow()),3)
End of next year => Date.EndOfYear(Date.AddYear(Date.From(DateTime.LocalNow()),1))
Hi @IF ,
Both Omid_Motamedise and SamWiseOwl have provided great solutions. Hope they could help you.
If possible, accept the replies as solutions. This will make it easier for the future people to find the answer quickly.
Best Regards,
Stephen Tao
You can add year to specific date by Date.AddYear and also calculate the last date of a year by Date. EndOfYear.
So your dates can be achieved by the below formual.
Today date => Date.from(DateRime.LocalNow())
Date of next three year=> Date.AddYear(Date.from(DateRime.LocalNow()),3)
End of next year => Date.EndOfYear(Date.AddYear(Date.From(DateTime.LocalNow()),1))
THank you. I was asking three year backwards. Is it supposed to be:
Date of next three year=> Date.AddYear(Date.from(DateRime.LocalNow()),-3)
= Date.FromText( Text.From( Date.Year(Date.AddYears( Date.From(DateTime.LocalNow()),1))) & "-12-31")
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.