Reputation: 5471
Data Source
event_date | credits_collected | credits_redeemed | credits_balance |
---|---|---|---|
2020-01-08 | 900 | 700 | 200 |
2020-02-15 | 500 | 300 | 400 |
2020-02-20 | 100 | 250 | 250 |
2020-03-19 | 600 | 850 | 0 |
2020-04-03 | 450 | 130 | 320 |
Target report:
event_month | credits_collected | credits_redeemed | credits_balance |
---|---|---|---|
1 | 900 | 700 | 200 |
2 | 600 | 550 | 250 |
3 | 600 | 850 | 0 |
4 | 450 | 130 | 320 |
In the report I want to build a monthly sum over the columns credits_collected
and credits_redeemed
.
Additionally, I want to show the column credits_balance
.
However, in this column the value of the last event_date per month should be displayed
(as you can see fore example in month = 2)
I am able to get the monthly sum into my report but I have no idea how I can solve the issue with the last event_date per month.
Do you have any idea how I can achieve this in PowerBI?
Upvotes: 0
Views: 37
Reputation: 5471
I could solve the issue with following DAX-Formula:
credits_balance = CALCULATE(MAX(Tabelle1[credits_balance]),ENDOFMONTH(Tabelle1[event_date]))
Upvotes: 0