Forum Discussion
Previous Quarter
How can I calculate Previous Quarter like I've calculated the current month using the below calculation.
I want a measure to show the values for the previous quarter.
I think if I get something like, IsLastQuarter = True/False hen my issue will be resolved.
- Anonymous3 years ago
Hi Anonymous ,
Please check if this is the result you want:
IsCurrentQuarter = VAR _CUR_QUARTER = QUARTER ( TODAY() ) VAR _CUR_YEAR = YEAR ( TODAY() ) VAR _RESULT = SWITCH ( TRUE (), _CUR_QUARTER <> 1 && YEAR ( 'D_DATE'[FULL_DATE] ) = _CUR_YEAR && QUARTER ( 'D_DATE'[FULL_DATE] ) = _CUR_QUARTER - 1, "Yes", _CUR_QUARTER = 1 && YEAR ( 'D_DATE'[FULL_DATE] ) = _CUR_YEAR - 1 && QUARTER ( 'D_DATE'[FULL_DATE] ) = 4, "Yes", "No" ) RETURN _RESULTBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
2 Replies
- amitchandakSuper User
Anonymous , Calculations based on Today
QTD Today =
var _max = today()
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))QTD Yesterday =
var _max = today()-1
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))LQTD Today =
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
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))LYQTD Today =
var _max = Date(year(today())-1, Month(Today()), day(today()))
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))This Qtr Today =
var _today = today()
var _max = eomonth(_today, if( mod(Month(_today),3) =0,0,3-mod(Month(_today),3)))
var _min = eomonth(_max,-3)+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))Last Qtr Today =
var _today = today()
var _max = eomonth(_today, -1*if( mod(Month(_today),3) =0,3,mod(Month(_today),3)))
var _min = eomonth(_max,-3)+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))Same Qtr Last Year Today =
var _today = today()
var _max = eomonth(eomonth(_today, if( mod(Month(_today),3) =0,0,3-mod(Month(_today),3))),-12)
var _min = eomonth(_max,-3)+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))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 - AnonymousNot applicable
Hi Anonymous ,
Please check if this is the result you want:
IsCurrentQuarter = VAR _CUR_QUARTER = QUARTER ( TODAY() ) VAR _CUR_YEAR = YEAR ( TODAY() ) VAR _RESULT = SWITCH ( TRUE (), _CUR_QUARTER <> 1 && YEAR ( 'D_DATE'[FULL_DATE] ) = _CUR_YEAR && QUARTER ( 'D_DATE'[FULL_DATE] ) = _CUR_QUARTER - 1, "Yes", _CUR_QUARTER = 1 && YEAR ( 'D_DATE'[FULL_DATE] ) = _CUR_YEAR - 1 && QUARTER ( 'D_DATE'[FULL_DATE] ) = 4, "Yes", "No" ) RETURN _RESULTBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data