Forum Discussion
Reverse Cumulative measure
Hi all,
I am trying to create a reverse cumulative measure and I am having difficulty when there are blanks in my data.
Using this calculated measure, I get the table below, but where there are blanks, the value comes out as the total.
Cumulative =
| DaysDiff | Registrations | Cumulative |
| 0 | 134 | 460 |
| 1 | 85 | 326 |
| 2 | 49 | 241 |
| 3 | 47 | 192 |
| 4 | 34 | 145 |
| 5 | 27 | 111 |
| 6 | 11 | 84 |
| 7 | 17 | 73 |
| 8 | 17 | 56 |
| 9 | 11 | 39 |
| 10 | 13 | 28 |
| 11 | 3 | 15 |
| 12 | 1 | 12 |
| 13 | 460 | |
| 14 | 460 | |
| 15 | 3 | 11 |
| 16 | 2 | 8 |
| 17 | 2 | 6 |
| 18 | 460 | |
| 19 | 460 | |
| 20 | 1 | 4 |
| 21 | 460 | |
| 22 | 460 | |
| 23 | 460 | |
| 24 | 3 | 3 |
Can anyone help me modify the calculation, so on the days where there are blank registrations, the cumulative column just takes the value above. I don't want to get rid of the blank rows, as I need all the daysdiff there.
The model I am using can only create calculated measures and not columns.
The final table should look like the below:
| DaysDiff | Registrations | Cumulative |
| 0 | 134 | 460 |
| 1 | 85 | 326 |
| 2 | 49 | 241 |
| 3 | 47 | 192 |
| 4 | 34 | 145 |
| 5 | 27 | 111 |
| 6 | 11 | 84 |
| 7 | 17 | 73 |
| 8 | 17 | 56 |
| 9 | 11 | 39 |
| 10 | 13 | 28 |
| 11 | 3 | 15 |
| 12 | 1 | 12 |
| 13 | 12 | |
| 14 | 12 | |
| 15 | 3 | 11 |
| 16 | 2 | 8 |
| 17 | 2 | 6 |
| 18 | 6 | |
| 19 | 6 | |
| 20 | 1 | 4 |
| 21 | 4 | |
| 22 | 4 | |
| 23 | 4 | |
| 24 | 3 | 3 |
Thanks
9 Replies
- amitchandak
Super User
Check
reverse cumm = var _cumm =CALCULATE ( sum('Registrations'[Registrations]), FILTER( ALL( 'Registrations'[DaysDiff]), 'Registrations'[DaysDiff] <=MAXX(all('Registrations'),'Registrations'[DaysDiff]))) var _ear =CALCULATE ( sum('Registrations'[Registrations]), FILTER( ALL( 'Registrations'[DaysDiff]), 'Registrations'[DaysDiff] <=MAX('Registrations'[DaysDiff])-1)) return _cumm -_earThere is minor diff, please check
Solution link :https://www.dropbox.com/s/dvrkkmupwk4r7fz/ReverseCumm.pbix?dl=0
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin- AtifzFrequent Visitor
hi amitchandak,
I get an error at this part in in both of the rows.
sum('Registrations'[Registrations])If it helps, [Registrations] is a measure made from CountA([BidderID]), where BidderID is a string.
Thanks
- amitchandak
Super User
Try using CountA([BidderID]) or [Registrations], in place of Registrations[Registrations]