Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
However when I select a year is not working correctly,
Measure:
Solved! Go to Solution.
Thanks for the reply from DataNinja777 , please allow me to provide another insight:
Hi @lauramirlyn1 ,
I created some data:
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:
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
Thanks for the reply from DataNinja777 , please allow me to provide another insight:
Hi @lauramirlyn1 ,
I created some data:
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:
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
Hi @lauramirlyn1 ,
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,
Hi @lauramirlyn1 ,
I tried with the dummy data and it is producing your required output in both before and after Pareto% measures.
I have attached an example pbix file.
Best regards,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
60 | |
60 | |
49 | |
45 |