Forum Discussion
How to add fixed amount
Hello dear members.
I need your help once more.
I have a fund report with inflows and outflows from 1/1/2016 until now.
I would like to calculate the ( inflows - outflows) day by day but I need to add at the 1/1/2019 a fixed amount (100.000).
So for example I want to calculate for 1/1/2019 the following:
(100000 + inflows) - outflows.
Every day I want to add in the inflows the remaining amount of the previous day and subtract the outflows.
The result I want to be added at the inflows of the 2/1/2019 etc.
How can you achive that?
Thank you very much!
Hi Anonymous
Thank you very much for your solution.To be honest i managed to solve it on my own based on the solution of FreemanZ
I calculated theAmount = VAR _mindate = MIN(TableName[Date]) VAR _maxdate = MAX(TableName[Date]) VAR _fixedamount = IF(_mindate<=DATE(2019,1,1)&& _maxdate >=DATE(2019,1,1), 100, 0) RETURN SUM(TableName[Inflows]) + _fixedamount - SUM(TableName[Outflows])
And then I calculated the running total 🙂
But thank you very much. Your help is greatly appreciated.
Unfortynately I cannot creat a calculated column at my model 😞
6 Replies
- FreemanZ
Super User
try to create a measure like this:
Amount = VAR _mindate = MIN(TableName[Date]) VAR _maxdate = MAX(TableName[Date]) VAR _fixedamount = IF(_mindate<=DATE(2019,1,1)&& _maxdate >=DATE(2019,1,1), 100, 0) RETURN SUM(TableName[Inflows]) + _fixedamount - SUM(TableName[Outflows])in case of issue, please consider provide some sample data and @me
- Dimitris_Kats
Helper V
Dear FreemanZ
Thank you very much for replying to me.
Let me give you some data
date Inflow Outflow 20/12/2018
150 130 21/12/2018 100 90 22/12/2018 150 140 23/12/2018 200 160 24/12/2018 160 160 25/12/2018 200 210 26/12/2018 110 100 27/12/2018 60 100 28/12/2018 180 150 29/12/2018 180 90 30/12/2018 120 60 31/12/2018 100 50 1/1/2019 150 100 2/1/2019 100 100 3/1/2019 180 100 4/1/2019 90 60 5/1/2019 100 50 The desired result for 1/1/2019 will be the result of inflows - outflows +Fixed amount
So for the 1/1/2019 the result will be 150 (inflows of 1/1/2019) - 100 (outflows of 1/1/2019) + 100 (fixed amount) = 150
For the 2/1/2019 the result will be 150 (previous day result) + 100 (inflows of 2)/1/2019- 100 (outflows of 2/1/2019) = 150
etcHow can achive that?
Thank you very much again for your help!!!
- FreemanZ
Super User
how do you expect to present your result?