Forum Discussion
Calculate Monthly based on Cumulative Total
- 5 years ago
ISGirl Are the amounts in your table already cumulative amounts (i.e. there is no column that specifies the amount that each month had against it)? If you have a monthly amount, you should be able to just drag the Amount field into a visual with the Period field without any measure.
I may be misunderstanding what you are after? Apologies on my end.
- 5 years ago
I am so sorry for the misunderstanding! That is my bad. This should help
Monthly Amount = TOTALMTD ( SUM ( 'Table'[Amount] ) , 'Table'[Posted Date] ) - CALCULATE ( SUM ( 'Table'[Amount] ) , DATEADD ( 'Table'[Posted Date] , -1 , MONTH ) , ALL ( 'Table' ) )The above can be broken down using variables as follows:
Monthly Amount = VAR _TotalMth = TOTALMTD ( SUM ( 'Table'[Amount] ) , 'Table'[Posted Date] ) VAR _TotalLstMth = CALCULATE( [Sum Amount] , DATEADD ( 'Table'[Posted Date] , -1 , MONTH ) , ALL ( 'Table' ) ) RETURN _TotalMth - _TotalLstMthHope this helps and apologies again!
Theo 🙂
- 5 years ago
ISGirl -
You might need some more tweaking if you have additional data but the example could serve as a template
Distributed Amount = DIVIDE( CALCULATE( MAX(TableName[Amount]), FILTER( ALL(TableName), TableName[FiscalYear] ) ), CALCULATE( COUNTROWS(TableName), FILTER( ALL(TableName), TableName[FiscalYear] ) ) )
ISGirl my apologies, you should just be able to drag the Amount column without a measure if you are just after the monthly amount total?
It still showing cumulative. Thank you so much for your help!
- TheoC5 years ago
Community Champion
ISGirl Are the amounts in your table already cumulative amounts (i.e. there is no column that specifies the amount that each month had against it)? If you have a monthly amount, you should be able to just drag the Amount field into a visual with the Period field without any measure.
I may be misunderstanding what you are after? Apologies on my end.
- ISGirl5 years agoNew Member
I don't have monthly amount (only for January), the rest of months are cumulative. So I need formula calculating monthly amount based on cumulative.
- TheoC5 years ago
Community Champion
I am so sorry for the misunderstanding! That is my bad. This should help
Monthly Amount = TOTALMTD ( SUM ( 'Table'[Amount] ) , 'Table'[Posted Date] ) - CALCULATE ( SUM ( 'Table'[Amount] ) , DATEADD ( 'Table'[Posted Date] , -1 , MONTH ) , ALL ( 'Table' ) )The above can be broken down using variables as follows:
Monthly Amount = VAR _TotalMth = TOTALMTD ( SUM ( 'Table'[Amount] ) , 'Table'[Posted Date] ) VAR _TotalLstMth = CALCULATE( [Sum Amount] , DATEADD ( 'Table'[Posted Date] , -1 , MONTH ) , ALL ( 'Table' ) ) RETURN _TotalMth - _TotalLstMthHope this helps and apologies again!
Theo 🙂