Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Paulyeo11
Impactful Individual
Impactful Individual

How to create accumulate % for 8020 Table ?

Hi All

Below my raw data :-

https://www.dropbox.com/s/v2eypdrj51k4yvd/8020%20V001.pbix?dl=0

Paulyeo11_0-1602676219592.png

Expected result in yellow :-

Paulyeo11_1-1602676307107.png

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Paulyeo11 ,

 

Try this:

 

1. Add an index column in Power Query Editor.

add index.JPG

 

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 )

measure.JPG

  • 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 )

column.JPG

 

 

Best regards

Icey

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

7 REPLIES 7
Icey
Community Support
Community Support

Hi @Paulyeo11 ,

 

Try this:

 

1. Add an index column in Power Query Editor.

add index.JPG

 

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 )

measure.JPG

  • 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 )

column.JPG

 

 

Best regards

Icey

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

amitchandak
Super User
Super User

@Paulyeo11 , 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)))

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

Paulyeo11_0-1602677368364.png

 

@Paulyeo11 , Try like

 

divide(Sum(Table[Acc Total]), calculate(sum(Table[Sales]), all(Table)))

Hi Amit

 

In my aactual data , i still dont have Acc Total field :-

 

divide(Sum(Table[Acc Total]), calculate(sum(Table[Sales]), all(Table)))

 

Paul

 

Please find the file.

 

Hi Amit

Very sorry for send my sample file with extra field , below is only 2 field in my PBI file :-

Paulyeo11_0-1602680052784.png

kindly open my below actual raw data file :-

https://www.dropbox.com/s/48v9ajfgormrk6c/8020%20V001a.pbix?dl=0

and hope that you can help me get the accumulated % 

meaning you need 2 expression , first to get the ACC Total field , then get the % field.

 

Paul

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.