Forum Discussion
navafolk
Helper IV
4 years agoMeasure difference of two last rows in matrix visual (reference to another measure(s))
Hi pros, My data looks like: I am preparing visual matrix as below: in which MTD in value is a measure: MTD = totalmtd(sum('Table'[Amount]),'Table'[Date],filter('Tab...
- 4 years ago
Hi, navafolk ;
Try it.
MTD diff = var _max=CALCULATE(MAX('Table'[source name.date]),ALL('Table')) var _min=CALCULATE(MAX('Table'[source name.date]),FILTER(ALL('Table'),[source name.date]<_max)) return IF(MAX([Date])>EOMONTH(MAX('Table'[source name.date]),-2), IF(ISINSCOPE('Table'[source name.date]), SUM([Amount]), CALCULATE(SUM([Amount]),FILTER('Table',[source name.date]=_max))-CALCULATE(SUM([Amount]),FILTER('Table',[source name.date]=_min))))The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
4 years agoHi, navafolk ;
Try it.
MTD diff =
var _max=CALCULATE(MAX('Table'[source name.date]),ALL('Table'))
var _min=CALCULATE(MAX('Table'[source name.date]),FILTER(ALL('Table'),[source name.date]<_max))
return
IF(MAX([Date])>EOMONTH(MAX('Table'[source name.date]),-2),
IF(ISINSCOPE('Table'[source name.date]),
SUM([Amount]),
CALCULATE(SUM([Amount]),FILTER('Table',[source name.date]=_max))-CALCULATE(SUM([Amount]),FILTER('Table',[source name.date]=_min))))
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Matex
1 year agoFrequent Visitor
Works perfectly. Thank you