Forum Discussion
measure
- 9 years ago
Hope this helps! :smileyhappy:
New Table = SUMMARIZE ( 'Table', 'Table'[Type], "Count of Type", COUNTROWS ( 'Table' ), "Type Rank by Count", RANKX ( ALL ( 'Table'[Type] ), CALCULATE ( COUNTROWS ( 'Table' ) ) ) ) Cumulative Sum Column = CALCULATE ( SUM ( 'New Table'[Count of Type] ), FILTER ( 'New Table', 'New Table'[Type Rank by Count] <= EARLIER ( 'New Table'[Type Rank by Count] ) ) )Continued here...
http://community.powerbi.com/t5/Desktop/cumulative-sum/m-p/136762/highlight/false#M58688
You probably need to do a SUMMARIZE where you essentially dynamically create a table that effectively has rows in which that measure is evaluated and feed that to your FILTER as the table. Only so much I can do without seeing some sample data but your situation seems similar to one I ran into here:
https://community.powerbi.com/t5/Desktop/Data-Modeling-Issue-Fun/m-p/125007#M52919
Here is the visual of my data. the last column is the one that i am trying to create.
i tried the summarize but then there is an error that says about max when i used the column defined in the summarize
| Type | count_product | Cumulative sum |
| 1 | 500 | 500 |
| 3 | 330 | 830 |
| 2 | 220 | 1050 |
- Sean9 years agoCommunity Champion
Hope this helps! :smileyhappy:
New Table = SUMMARIZE ( 'Table', 'Table'[Type], "Count of Type", COUNTROWS ( 'Table' ), "Type Rank by Count", RANKX ( ALL ( 'Table'[Type] ), CALCULATE ( COUNTROWS ( 'Table' ) ) ) ) Cumulative Sum Column = CALCULATE ( SUM ( 'New Table'[Count of Type] ), FILTER ( 'New Table', 'New Table'[Type Rank by Count] <= EARLIER ( 'New Table'[Type Rank by Count] ) ) )Continued here...
http://community.powerbi.com/t5/Desktop/cumulative-sum/m-p/136762/highlight/false#M58688