Forum Discussion
In and out-flow from money. Create difference and aggregate value by month.
Hi sven7,
Add a calendar table and don't make any relationship between both tables.
Then add this measure:
Balance =
var DimDate = MAX('Calendar'[Date])
return
TOTALYTD(SUM(Money_In_Out[Amount received])-SUM(Money_In_Out[Amount taken]),Money_In_Out[Date]<= DimDate)Regards,
MFelix
MFelix Thanks again for your help.
I have tried this approach, but it only gives me the same value for all dates. I have created a seperated table with the calendarauto function, made sure there is no connection to other tables and put in your formula and adjusted it according to my names.
Do you have an idea why there is the same value everywhere?
Thanks in advance and BR
Sven
- v-jiascu-msft8 years ago
Microsoft Employee
Hi sven7,
How did you create the visuals? It seems this simple measure is enough. You can see it from the snapshot.
Measure = SUM ( Table1[Amount received] ) - SUM ( Table1[Amount taken] )
Best Regards!
Dale
- sven78 years agoFrequent Visitor
thanks for your tips. I believe that my description was not accurate enough. I would like to see how the available cash balance increases or decreases by month and see the total current cash balance in the latest month. I have already created the graph in Excel, but I would like to create the formula in Power BI because the Excel dta is outdated.
Our different accounts shall be reflected in a stacked chart by the balance each month and aggregate until the latest month. I only imported the data sheet from Excel.
Thanks again for all your help in this community.
BR Sven
- MFelix8 years ago
Super User
Hi sven7,
What is the month column you have in your table is it from calendar or from you data table?
Regards,
MFelix