I am using the customized calendar. Hence I require help with the previous quarter's formula. I was able to calculate the previous month by using the DAX code Below
Previous Month Sale =
var currentmonth = SELECTEDVALUE(Dates[FiscalPeriod])
var currentYear = SELECTEDVALUE(Dates[FiscalYear])
var maxmonthnum = CALCULATE(MAX(Dates[FiscalPeriod]),ALL(Dates))
return
IF(HASONEVALUE(Dates[FiscalPeriod]),
SUMX(
FILTER(ALL(Dates),
IF(currentmonth = 1,
Dates[FiscalPeriod] = maxmonthnum && Dates[FiscalYear] = currentYear -1,
Dates[FiscalPeriod] = currentmonth -1 && Dates[FiscalYear] = currentYear)),
'Selected Measures'[Selected Measure]),
BLANK())
and previous year as
Total Sale SPLY =
var currentperiod = SELECTEDVALUE(Dates[FiscalPeriod])
var currentyear = SELECTEDVALUE(Dates[FiscalYear])
return
CALCULATE([Total Sale Selected Currency],
FILTER(ALL(Dates),
---Dates[FiscalPeriod] = currentperiod &&
Dates[FiscalYear] = currentyear -1 &&
Dates[Is past] = TRUE))
but I am not able to calculate quarter . Please if someone can help me .
Thanks
Wuth Reagrds
Gauran
Previous Month Sale =
var currentmonth = SELECTEDVALUE(Dates[FiscalPeriod])
var currentYear = SELECTEDVALUE(Dates[FiscalYear])
var maxmonthnum = CALCULATE(MAX(Dates[FiscalPeriod]),ALL(Dates))
return
IF(HASONEVALUE(Dates[FiscalPeriod]),
SUMX(
FILTER(ALL(Dates),
IF(currentmonth = 1,
Dates[FiscalPeriod] = maxmonthnum && Dates[FiscalYear] = currentYear -1,
Dates[FiscalPeriod] = currentmonth -1 && Dates[FiscalYear] = currentYear)),
'Selected Measures'[Selected Measure]),
BLANK())
and previous year as
Total Sale SPLY =
var currentperiod = SELECTEDVALUE(Dates[FiscalPeriod])
var currentyear = SELECTEDVALUE(Dates[FiscalYear])
return
CALCULATE([Total Sale Selected Currency],
FILTER(ALL(Dates),
---Dates[FiscalPeriod] = currentperiod &&
Dates[FiscalYear] = currentyear -1 &&
Dates[Is past] = TRUE))
but I am not able to calculate quarter . Please if someone can help me .
Thanks
Wuth Reagrds
Gauran