• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Previous Quarter formula

gauran

New Member
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
 
Back
Top