Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi Team,
I've following dataset:
Customer | Value | Sales |
A11 | 13.61% | 4200 |
A12 | 12.97% | 4000 |
A13 | 11.99% | 3700 |
A14 | 11.67% | 3600 |
A15 | 9.08% | 2800 |
A8 | 8.10% | 2500 |
A10 | 7.46% | 2300 |
A7 | 6.48% | 2000 |
A9 | 6.48% | 2000 |
A6 | 4.86% | 1500 |
A5 | 3.24% | 1000 |
A3 | 1.62% | 500 |
A2 | 1.30% | 400 |
A1 | 0.65% | 200 |
A4 | 0.49% | 150 |
I want to create a measure that gives me count of rows till it reaches 80.
I tried following dax:
Solved! Go to Solution.
Hello @valentina14 ,
You need %cummulatvie sales, not the only one. You can follow the large @AlbertoFerrari to calculate the ABC Classification in DAX Patterns for products and adapt it to your needs.
You must add 4 columns:
1) Customer Sales = Valentina[Sales]
2) Cummulative Sales =
VAR CurrentCustomerSales = Valentina[Customer Sales]
VAR BetterCustomers =
FILTER (
Valentina,
Valentina[Customer Sales] >= CurrentCustomerSales
)
VAR Result =
SUMX (
BetterCustomers,
Valentina[Customer Sales]
)
RETURN
Result
3) Cummulative Pct =
DIVIDE (
Valentina[Cumulated Sales],
SUM ( Valentina[Customer Sales] )
)
4) Pareto Class =
SWITCH (
TRUE,
Valentina[Cummulative Pct] <= 0.8, "80% Pareto",
Valentina[Cummulative Pct] <= 1, "20% Rest"
)
And you understand this:
I hope it helps.
Bless you
Fernando
P.S. If it helped, please consider liking the post and mark it as an answer!
Hi @Anonymous ,
I suggest create two calculated column one for rank and the other one for the cumulative value:
Rank = RANKX('Table','Table'[Value],,DESC)
Cvalue = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Rank]<=EARLIER('Table'[Rank])))
Then you can create a measure for card visual to gives me count of rows till cumulative value reaches 80%.
Measure = CALCULATE(MAX('Table'[Rank]),FILTER('Table','Table'[Cvalue]<=0.8))
For more details, please refer to the pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EambX0CGNMlFq-kc-72FNzIBEBkUDhTNJJgiT__a5m8IAw?e=hln0yM
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
I've spent most of my day trawling forums, YouTube and blogs for this answer. THANK YOU. I know calculated columns aren't advisable but this gets the job done way quicker than attempting a similar output in a measure. My visuals wouldn't even load due to the volume of data I'm working with but at least my visuals render once this is calculated per row and stamped on the table. Thanks again!
Hi,
The answer should be 7. You may download my PBI file from here.
Hope this helps.
Hello @valentina14 ,
You need %cummulatvie sales, not the only one. You can follow the large @AlbertoFerrari to calculate the ABC Classification in DAX Patterns for products and adapt it to your needs.
You must add 4 columns:
1) Customer Sales = Valentina[Sales]
2) Cummulative Sales =
VAR CurrentCustomerSales = Valentina[Customer Sales]
VAR BetterCustomers =
FILTER (
Valentina,
Valentina[Customer Sales] >= CurrentCustomerSales
)
VAR Result =
SUMX (
BetterCustomers,
Valentina[Customer Sales]
)
RETURN
Result
3) Cummulative Pct =
DIVIDE (
Valentina[Cumulated Sales],
SUM ( Valentina[Customer Sales] )
)
4) Pareto Class =
SWITCH (
TRUE,
Valentina[Cummulative Pct] <= 0.8, "80% Pareto",
Valentina[Cummulative Pct] <= 1, "20% Rest"
)
And you understand this:
I hope it helps.
Bless you
Fernando
P.S. If it helped, please consider liking the post and mark it as an answer!
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 |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |