Forum Discussion
BryanLy
6 years agoFrequent Visitor
Cumulative Surplus/Deficit Monthly
Hi all, I hope you are well. I am struggling with a measure now to get the right cumulative surplus/deficit each month. I have correct measures for Incomes & Expenses respectively. The calcul...
mahoneypat
6 years agoMicrosoft Employee
Looks like you need a running total. Please try an expression like this, replacing with your actual measure/table/column names. This assumes you have a Date table. If not, you'll need to remove the filter from your month and date column used in your visual with ALL(Table[Date], Table[Month]), but a Date table is recommended.
Surplus =
VAR maxdate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
[Income] - [Expenses],
ALL ( 'Date'[Date] ),
'Date'[Date] <= maxdate
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat