Forum Discussion
PREVIOUSMONTH & FITLER
Hi,
I am trying to report a previous month's number but only when another column is filtered. i would like the model to report the previous month count for when it is terminated. i have tried the following formula but no luck.
If i remove the last filter i can get the previous month count, but i only want the value for when the status is terminated.
Any ideas?
thanks
Try with IF:
=IF(MAX(Sheet1[Status]="Terminated",CALCULATE(SUM(Sheet1[WSE]),PREVIOUSMONTH(Sheet1[Report Date])), "-")
4 Replies
- Tahreem24
Super User
Try with IF:
=IF(MAX(Sheet1[Status]="Terminated",CALCULATE(SUM(Sheet1[WSE]),PREVIOUSMONTH(Sheet1[Report Date])), "-")
- AnonymousNot applicable
Tahreem24 Thank you for your assistance, unfortunately i received the below error when trying the Max function
"The MAX function only accepts a column reference as an argument"
- AnonymousNot applicable
Hi Anonymous
I would use the below formula and tweak it as required.
CALCULATE ( SUM(Sheet1[WSE]), FILTER ( ALLexcept(PREVIOUSMONTH(Sheet1[Report Date])), Sheet1[Status]=="Terminated" // The == operator distinguishes between blank and 0/empty string ), )- AnonymousNot applicable
Anonymous thanks for your help but i received the below error when using the ALLEXCEPT function
"The ALLEXCEPT function expects a table reference for argument 2, but a table expression was used"i tried a few variations of moving the PREVIOUSMONTH function but no luck