Forum Discussion
How to create accumulate % for 8020 Table ?
Hi All
Below my raw data :-
https://www.dropbox.com/s/v2eypdrj51k4yvd/8020%20V001.pbix?dl=0
Expected result in yellow :-
Hi Anonymous ,
Try this:
1. Add an index column in Power Query Editor.
2. Create measures or columns.
- Measures:
ACC TOTAL Measure = CALCULATE ( SUM ( 'Table (2)'[SALES] ), FILTER ( ALLSELECTED ( 'Table (2)' ), 'Table (2)'[Index] <= MAX ( 'Table (2)'[Index] ) ) )ACC PER CENT Measure = VAR Sum_ = CALCULATE ( SUM ( 'Table (2)'[SALES] ), ALLSELECTED ( 'Table (2)' ) ) RETURN DIVIDE ( [ACC TOTAL Measure], Sum_, 0 )- Columns:
ACC TOTAL Column = CALCULATE ( SUM ( 'Table (2)'[SALES] ), FILTER ( ALLSELECTED ( 'Table (2)' ), 'Table (2)'[Index] <= EARLIER( 'Table (2)'[Index] ) ) )ACC PER CENT Column = VAR Sum_ = SUM ( 'Table (2)'[SALES] ) RETURN DIVIDE ( [ACC TOTAL Column], Sum_, 0 )Best regards
Icey
If this post helps,then consider Accepting it as the solution to help other members find it faster.
7 Replies
- Icey
Community Support
Hi Anonymous ,
Try this:
1. Add an index column in Power Query Editor.
2. Create measures or columns.
- Measures:
ACC TOTAL Measure = CALCULATE ( SUM ( 'Table (2)'[SALES] ), FILTER ( ALLSELECTED ( 'Table (2)' ), 'Table (2)'[Index] <= MAX ( 'Table (2)'[Index] ) ) )ACC PER CENT Measure = VAR Sum_ = CALCULATE ( SUM ( 'Table (2)'[SALES] ), ALLSELECTED ( 'Table (2)' ) ) RETURN DIVIDE ( [ACC TOTAL Measure], Sum_, 0 )- Columns:
ACC TOTAL Column = CALCULATE ( SUM ( 'Table (2)'[SALES] ), FILTER ( ALLSELECTED ( 'Table (2)' ), 'Table (2)'[Index] <= EARLIER( 'Table (2)'[Index] ) ) )ACC PER CENT Column = VAR Sum_ = SUM ( 'Table (2)'[SALES] ) RETURN DIVIDE ( [ACC TOTAL Column], Sum_, 0 )Best regards
Icey
If this post helps,then consider Accepting it as the solution to help other members find it faster.
- amitchandak
Super User
Anonymous , Try like
New Measure , assume [Acc Total] is a measure
divide([Acc Total], calculate(sum(Table[Sales]), all(Table)))
or
divide([Acc Total], calculate(sum(Table[Sales]), allselected(Table)))
- AnonymousNot applicable
Hi Amit
For my actual raw data , only have field name = SALES , still dont have ACC TOTAL.
https://www.dropbox.com/s/v2eypdrj51k4yvd/8020%20V001.pbix?dl=0
- amitchandak
Super User
Anonymous , Try like
divide(Sum(Table[Acc Total]), calculate(sum(Table[Sales]), all(Table)))