Forum Discussion
jaartz
4 years agoNew Member
Changing Subtotal Aggregations for Measures in a Matrix Visual
Hi everyone, I have a dataset that looks like this: This is currently represented in a matrix visual. The subtotal of the first row returns the first value in the row and the subtota...
- 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
4 years agoNew Member
Thank you!