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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Problem Description:
Add Days, Month, and Year to a noncontinuous Date column or stand-alone Value.
Solution Overview :
In Date we can add and subtract dateparts from respective Date Parts
Solution: In date Add/Subtract Year, Month, and Day. You can even subtract more than 30 days or more than 12 months
Calendar:
Date = CALENDAR(date(2018,1-12,1),TODAY())
Measures
Today = TODAY()
Month Back Date = Var _DT = Today()
return Date(year(_DT),Month(_DT)-1,Day(_DT))
Year, Month, day Back Date = Var _DT = Today()
return Date(year(_DT)-1,Month(_DT)-10,Day(_DT)-1)
You can also find a pbix attached to this blog.
My Previous Blogs -
Date Difference Across Table- Direct Query Mode, Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard Time Periods and Comparing Data Across Date Ranges
Connect on LinkedIn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.