Forum Discussion
Changing Subtotal Aggregations for Measures in a Matrix Visual
- 4 years ago
jaartz , One option is to use
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Why previousmonth does not give result when datesmtd is giving it: https://youtu.be/1KkoJehRVeg
Another is swich using isinscope
if(isinscope (Date[Month Year]) , CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH))) , CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month)) )
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
jaartz , One option is to use
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Why previousmonth does not give result when datesmtd is giving it: https://youtu.be/1KkoJehRVeg
Another is swich using isinscope
if(isinscope (Date[Month Year]) , CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH))) , CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month)) )
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/