Forum Discussion
yaman123
5 years agoPost Partisan
Running Total Calculation
Hi all, I have seen online and theres many ways of calculating the running total or cumulative total. I have a column Collection Litres and a date column Sample Date. I woud like to calcula...
- 5 years ago
Hi yaman123
If your column Collection Litres and column Sample Date are in the same table, you may take steps below for reference.
1. create measure total_YTD
-total_YTD =var mmax = maxx(ALLSELECTED(Table6),Table6[Sample Date])var mmin = EDATE(mmax,-12)returncalculate(sum('Table6'[Collection Litres]), FILTER(all('Table6'), 'Table6'[Sample Date] >mmin && 'Table6'[Sample Date] <=mmax))--
it calculates the total_YTD between 2016/6/16 - 2017/6/30
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
v-xiaotang
5 years agoCommunity Support
Hi yaman123
If your column Collection Litres and column Sample Date are in the same table, you may take steps below for reference.
1. create measure total_YTD
-
total_YTD =
var mmax = maxx(ALLSELECTED(Table6),Table6[Sample Date])
var mmin = EDATE(mmax,-12)
return
calculate(sum('Table6'[Collection Litres]), FILTER(all('Table6'), 'Table6'[Sample Date] >mmin && 'Table6'[Sample Date] <=mmax))
-
-
it calculates the total_YTD between 2016/6/16 - 2017/6/30
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.