I've following dataset:
I want to create a measure that gives me count of rows till it reaches 80.
I tried following dax:
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 =
Valentina[Customer Sales] >= CurrentCustomerSales
VAR Result =
3) Cummulative Pct =
SUM ( Valentina[Customer Sales] )
4) Pareto Class =
Valentina[Cummulative Pct] <= 0.8, "80% Pareto",
Valentina[Cummulative Pct] <= 1, "20% Rest"
And you understand this:
I hope it helps.
P.S. If it helped, please consider liking the post and mark it as an answer!
View solution in original post
The answer should be 7. You may download my PBI file from here.
Hope this helps.
Hi @valentina14 ,
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-7...
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the on demand sessions that are available now!
Check out the Winners!
Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.