Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
have several time-based metrics such as MTD (Month-to-Date), YTD (Year-to-Date), and QTD (Quarter-to-Date). For the MTD calculation, I want it to show data from the 1st to the last day of the previous month if the current date is the 1st day of a new year. AND TODAY -1 FOR EACH Similarly, for QTD, I need it to display data from the start of the previous quarter until December 31st if a new quarter starts. OR normaly when new quater starts need to show previous quater , Additionally, for YTD, when it's January 1st of a new year, I'd like it to show data from January 1st of the previous year to December 31st of the previous year.
Could you please assist me in rewriting the logic for this calculated column?
Thank you very much for your help!
@Anonymous, Ideally you should use TI and create measures.
Here are some flags for Date Table
Addcolumns( <Table code> ,
"MTD", if([Date]<= today() && [Date] >= eomonth(today(), -1)+1, "MTD" )
"LMTD", if([Date]<= date(year(today()), month(today())-1, day(today())) && [Date] >= eomonth([Date], -2)+1, "LMTD" )
"QTD", var _max = today()
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
return
if([Date]<= _max && [Date] >= _min, "QTD" )
"LQTD" ,var _max = Date(year(today()), Month(Today())-3, day(today()))
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
if([Date]<= _max && [Date] >= _min, "LQTD" )
"YTD", if([Date]<= today() && [Date] >= eomonth(today(), -1* month(today()) )+1, "YTD" ) )
for TI
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!