The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I will greatly appreciate your input on the following -
I need to calculate the Sales Amount for the full quarter last year.
I am trying the following but the result is too high
Solved! Go to Solution.
@Anonymous , try measure like
Last year full qtr =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max2 = date(Year(_max1) -1, month(_max1) , Day(_max1))
var _min = eomonth(_max2,-1* if( mod(Month(_max2),3) =0,3,mod(Month(_max2),3)))+1
var _max = eomonth(_min,2)
return
CALCULATE([net] ,Filter('Date','Date'[Date]>= _min && 'Date'[Date] <= _max))
or
Qtr =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
refer if needed
https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27304
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
Thanks Amit.
Looks really neat!
I will try it out.
Thanks again!
@Anonymous , try measure like
Last year full qtr =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max2 = date(Year(_max1) -1, month(_max1) , Day(_max1))
var _min = eomonth(_max2,-1* if( mod(Month(_max2),3) =0,3,mod(Month(_max2),3)))+1
var _max = eomonth(_min,2)
return
CALCULATE([net] ,Filter('Date','Date'[Date]>= _min && 'Date'[Date] <= _max))
or
Qtr =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
refer if needed
https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27304
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))