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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Pareto measure do work correctly when adding a slicer by year

I am using the below  measure to create a pareto chart. If I dont select the years in the slicer it seems to be working correctly.

 

1.png

However when I select a year is not working correctly,

2.png

 

Measure:

Pareto % =
VAR _total = CALCULATE(
    [Total Cost]
    , ALLSELECTED('in'[Function L5])
)
VAR _current = [Total Cost]
VAR _sumTable = SUMMARIZE(
    ALLSELECTED('in')
    , 'in'[Function L5]
    , "Cost", [Total Cost]
)
VAR _cummulativeSum = SUMX(
    FILTER(_sumTable, [Total Cost]>= _current)
    ,[Total Cost]
)
RETURN
DIVIDE(_cummulativeSum, _total)
 
Can someone help me figure out what Im missing here!
Thanks,
Laura
 
 
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from DataNinja777 , please allow me to provide another insight: 
Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1724034719447.png

 

Here are the steps you can follow:

1. Create measure.

Pareto % =
VAR _total = CALCULATE(
    [Total Cost]
    , ALLSELECTED('in'[Function L5])
)
VAR _sumTable = SUMMARIZE(
    ALLSELECTED('in')
    , 'in'[Function L5]
    , "Cost", [Total Cost]
)
VAR _sumTable2 =
ADDCOLUMNS(
    _sumTable,"Sum_Cummulativesum",SUMX(FILTER(_sumTable,[Cost]>=EARLIER([Cost])),[Total Cost]))
var _cummulativeSum=
SUMX(
    FILTER(_sumTable2,[Function L5]=MAX('in'[Function L5])),[Sum_Cummulativesum])
RETURN
DIVIDE(
   _cummulativeSum,_total)

2. Result:

vyangliumsft_1-1724034719452.png

If the results above don't meet your expectations, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

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

4 REPLIES 4
Anonymous
Not applicable

Thanks for the reply from DataNinja777 , please allow me to provide another insight: 
Hi  @Anonymous ,

I created some data:

vyangliumsft_0-1724034719447.png

 

Here are the steps you can follow:

1. Create measure.

Pareto % =
VAR _total = CALCULATE(
    [Total Cost]
    , ALLSELECTED('in'[Function L5])
)
VAR _sumTable = SUMMARIZE(
    ALLSELECTED('in')
    , 'in'[Function L5]
    , "Cost", [Total Cost]
)
VAR _sumTable2 =
ADDCOLUMNS(
    _sumTable,"Sum_Cummulativesum",SUMX(FILTER(_sumTable,[Cost]>=EARLIER([Cost])),[Total Cost]))
var _cummulativeSum=
SUMX(
    FILTER(_sumTable2,[Function L5]=MAX('in'[Function L5])),[Sum_Cummulativesum])
RETURN
DIVIDE(
   _cummulativeSum,_total)

2. Result:

vyangliumsft_1-1724034719452.png

If the results above don't meet your expectations, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

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

DataNinja777
Super User
Super User

Hi @Anonymous ,

 

Please try the following dax formula which respect any slicers applied to the data, including year slicers. This ensures that the calculations are only done within the context of the selected year(s) or any other slicers.

 

Pareto % =
VAR _total = CALCULATE(
    SUM('in'[Total Cost]),
    ALLSELECTED('in')
)
VAR _current = [Total Cost]
VAR _sumTable = 
    SUMMARIZE(
        ALLSELECTED('in'),
        'in'[Function L5],
        "Cost", SUM('in'[Total Cost])
    )
VAR _cumulativeSum = 
    SUMX(
        FILTER(_sumTable, [Cost] >= _current),
        [Cost]
    )
RETURN
DIVIDE(_cumulativeSum, _total)

Best regards,

Anonymous
Not applicable

Hi @DataNinja777 ,

I tried it and still doing the same.

lauramirlyn1_0-1723815563667.png

 

Hi @Anonymous ,

 

I tried with the dummy data and it is producing your required output in both before and after Pareto% measures.  

DataNinja777_1-1723821012419.png

DataNinja777_2-1723821030681.png

DataNinja777_3-1723821070182.png

 

 

DataNinja777_0-1723820986919.png

I have attached an example pbix file.  

Best regards,

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors