Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Good afternoon
I need to classify a column (contracts) that accumulate 80% of the sale. The table below shows all the contracts with their imports and the % of the total.
I want to put together a measure that the first contracts that add up to 80% are classified as A, and that the remaining 20 are B. There can be two measures as well.
How can I put together a measure or what do you recommend doing?
Thank you.
Solved! Go to Solution.
Hi @Syndicate_Admin
Take a look at the linked tutorial, it seems like the same scenario with a little modifying according to your needs.
https://www.youtube.com/watch?v=jCK-RUMggkM
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi @jjgamenara
Please try:
ABC Class Optimized =
VAR SalesByProduct = ADDCOLUMNS (ALL('Table'[ID]), "@Sales", [Total Sales] )
VAR CurrentSales = [Total Sales]
VAR BetterProducts = FILTER ( SalesByProduct, [@Sales] >= CurrentSales )
VAR CumulatedSales = SUMX ( BetterProducts, [@Sales] )
VAR AllSales = CALCULATE ( [Total Sales], ALL ( 'Table'[ID] ) )
VAR CumulatedPct = DIVIDE ( CumulatedSales, AllSales )
VAR AbcClass = IF(CumulatedPct <= 0.8, "A","B")
RETURN
AbcClass
Output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi,
Share the download link of the PBI file.
Hi @jjgamenara
Please try:
ABC Class Optimized =
VAR SalesByProduct = ADDCOLUMNS (ALL('Table'[ID]), "@Sales", [Total Sales] )
VAR CurrentSales = [Total Sales]
VAR BetterProducts = FILTER ( SalesByProduct, [@Sales] >= CurrentSales )
VAR CumulatedSales = SUMX ( BetterProducts, [@Sales] )
VAR AllSales = CALCULATE ( [Total Sales], ALL ( 'Table'[ID] ) )
VAR CumulatedPct = DIVIDE ( CumulatedSales, AllSales )
VAR AbcClass = IF(CumulatedPct <= 0.8, "A","B")
RETURN
AbcClass
Output:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hi @Syndicate_Admin
Take a look at the linked tutorial, it seems like the same scenario with a little modifying according to your needs.
https://www.youtube.com/watch?v=jCK-RUMggkM
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |