Forum Discussion
In and out-flow from money. Create difference and aggregate value by month.
Dear Power Bi Users,
I am struggling with a little issue right now. I did some research in this forum but did not find the right solution. Maybe I am just on the wrong path, this is why I hope there might be a simple answer.
This is some sample data. I have a register of various accounts and money which went in and out on these accounts on a certain date. The date is transformed into a month format.
| Account | Date | Month | Amount taken | Amount received |
| ZZZ Bank | 21.02.2017 | 2017-02 | 10 | |
| AAA Bank | 20.02.2017 | 2017-02 | 5 | |
| ZZZ Bank | 01.02.2017 | 2017-02 | 7 | |
| ZZZ Bank | 01.03.2017 | 2017-03 | 21 |
Now I would like to create a table/formula which can reproduce the information to a total balance each month. So how much money we have in total, thus adding previous month etc.
| ZZZ Bank | AAA Bank | Cash | |
| 2017-01 | |||
| 2017-02 | -17 | 5 | |
| 2017-03 | 21 | ||
| 2017-04 | |||
| 2017-05 | |||
| 2017-06 | |||
| 2017-07 | |||
| 2017-08 | |||
| 2017-09 | |||
| 2017-10 | |||
| 2017-11 | |||
| 2017-12 |
With the data I want to create a stacked chart (accounts and their values by month), which should be pretty easy with having the information.
I thought about a CALCUATE Formula, but somehow I do not get it running.
I appreciate any advice or tips.
Thanks in advance.
Sven
Hi sven7,
You are using a column you should use a measure, columns are always calculated at row level, measures are calculated at context level so taking into account the different levels of information.
Change your column to a measure and it will work,
Regards,
MFelix
22 Replies
- sven7Frequent VisitorMFelix thanks for your advice. I was also trying this approach but it is only a partly solution. It only gives me the difference per month, meaning if I generated a plus or minus in the month. I also would like to know what is my current cash balance. So there would need to be like aome kind of aggregate from the previous month to see the total available money by month. Do you maybe also have a good idea to this point?
Thanks in advance and Br
Sven