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
Anonymous
Not applicable

Creating cumulative percentage

Hi i have the below table visual and i am looking at calculating the cumulative percentage. I created the below measure however its not calculating this properly. Can anyone please advise? 

 

Loss reason Table visual.PNGCumulative percentage.PNG

2 ACCEPTED SOLUTIONS
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

here is a sample. Adjust it for your needs:

 

06-05-_2021_21-58-24.png

 

Running Percentage = 
VAR _Total =
    CALCULATE ( [Waste Value], ALL ( 'Table' ) )
VAR _Percentage =
    DIVIDE ( [Waste Value], [Total] )
VAR _WasteValue =
    SUM ( 'Table'[Waste Value_] )
RETURN
    IF (
        HASONEVALUE ( 'Table'[Loss Reason] ),
        CALCULATE (
            [Percentage],
            FILTER (
                ALL ( 'Table' ),
                'Table'[Waste Value_] >= MAX ( 'Table'[Waste Value_] )
            )
        )
    )

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous  ,

Created some data:

v-yangliu-msft_3-1620638128985.png

Here are the steps you can follow:

1. Enter power query through Transform data, Add Column – Index Column –From 1.

v-yangliu-msft_1-1620637915600.png

2. Create measure.

Expected Output =
var _1=SUMX(FILTER(ALLSELECTED('Table'),'Table'[Index]<=MAX('Table'[Index])),'Table'[Waste Value])
var _2= SUMX(ALL('Table'),'Table'[Waste Value])
return
DIVIDE(_1,_2)

3. Result:

v-yangliu-msft_2-1620637915603.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous  ,

Created some data:

v-yangliu-msft_3-1620638128985.png

Here are the steps you can follow:

1. Enter power query through Transform data, Add Column – Index Column –From 1.

v-yangliu-msft_1-1620637915600.png

2. Create measure.

Expected Output =
var _1=SUMX(FILTER(ALLSELECTED('Table'),'Table'[Index]<=MAX('Table'[Index])),'Table'[Waste Value])
var _2= SUMX(ALL('Table'),'Table'[Waste Value])
return
DIVIDE(_1,_2)

3. Result:

v-yangliu-msft_2-1620637915603.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sayaliredij
Super User
Super User

Hi @Anonymous 

You can use the following formula

 

Regards,

Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly

 
**bleep** PCT = 

var total =CALCULATE('Waste Data Measures'[Waste Value Total],REMOVEFILTERS('Waste Data Measures'[Loss Reason]))

var cur = 'Waste Data Measures'[Waste Value Total]

RETURN

DIVIDE(cur,total,0)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




FrankAT
Community Champion
Community Champion

Hi @Anonymous 

here is a sample. Adjust it for your needs:

 

06-05-_2021_21-58-24.png

 

Running Percentage = 
VAR _Total =
    CALCULATE ( [Waste Value], ALL ( 'Table' ) )
VAR _Percentage =
    DIVIDE ( [Waste Value], [Total] )
VAR _WasteValue =
    SUM ( 'Table'[Waste Value_] )
RETURN
    IF (
        HASONEVALUE ( 'Table'[Loss Reason] ),
        CALCULATE (
            [Percentage],
            FILTER (
                ALL ( 'Table' ),
                'Table'[Waste Value_] >= MAX ( 'Table'[Waste Value_] )
            )
        )
    )

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

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.