Forum Discussion
Avg Balance DAX
- 4 years ago
Hi Guys,
ill try to be more specific.
I would like to know what is the Coin balance in each time datapoint on my timeline.
It mean that for every date I would like to sum the last coin balance for each user_id untill that specific date and then divide by the number of players.
The outcome will be chart like that (disregard the values):
The table is created in a way that in each date user id can appear only once!
my table:
| DATE | USER_ID | COIN_BALANCE |
| 6/1/2022 | 572EDE3F07F53CDD | 800 |
| 6/1/2022 | 7FBF5E6AC1126381 | 1 |
| 6/1/2022 | CB086763FC1E3CC6 | 4 |
| 6/1/2022 | CE471B4692E6B8ED | 120 |
| 6/1/2022 | F40C6A78878151B3 | 92 |
| 6/2/2022 | 233E855015CD3431 | 69 |
| 6/2/2022 | 73703E52FAD56095 | 66 |
| 6/2/2022 | A6499BEE8D6C8A40 | 48 |
| 6/2/2022 | CB086763FC1E3CC6 | 9 |
| 6/2/2022 | CE471B4692E6B8ED | 135 |
The measure results should be like that:
For day 1 it's easy calculation because I have 5 different users, i just sum up all 1017/5 = 203.4
For day 2 the calculation should include users that might be online in day 1 as well, but I want to take the last coin balance for each user_id then : 1220/8 = 152.5 (8 Different users included, 3 from day 1 and 5 from day 2)
- Ashish_Mathur4 years agoSuper User