Forum Discussion
Anonymous
6 years agoNot applicable
SUM VALUES FOR THE PREVIOUS ROUND
Hello...
I have table employee
which have
| ID | VALUE | ROUND |
| 1 | 10 | 1 |
| 2 | 10 | 1 |
| 3 | 10 | 1 |
| 4 | 20 | 2 |
| 5 | 30 | 2 |
| 6 | 20 | 3 |
| 7 | 20 | 3 |
| 8 | 20 | 3 |
and round table which have
| ROUND |
| 1 |
| 2 |
| 3 |
how to write dax eqaution to sum values for previous round
eg. output
| ROUND | sum | prev sum |
| 1 | 30 | |
| 2 | 50 | 30 |
| 3 | 60 | 50 |
3 Replies
- AlBCommunity Champion
Hi Anonymous
Measure = CALCULATE ( SUM ( Table1[VALUE] ), FILTER ( ALL ( Table1[Round] ), Table1[Round] = ( SELECTEDVALUE ( Table1[Round] ) - 1 ) ) )Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers

- AnonymousNot applicable
thank you for responding...
but ssas doesn't support the function
SELECTEDVALUE
is there any work around ?
- AlBCommunity Champion
Measure = CALCULATE ( SUM ( Table1[VALUE] ), FILTER ( ALL ( Table1[Round] ), Table1[Round] = IF ( HASONEVALUE ( Table1[Round] ), VALUES ( Table1[Round] ) - 1 ) ) )Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers
