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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
AlexandruP
Frequent Visitor

Count of dynamic ABC measure

Hi,

 

I have a dynamic ABC measure that calculates top 80% of sales by product nr, further 15% and last 5% (A,B and C products)

using the Microsoft tutorial on Dynamic ABC. Howerer I am unable to perform a count of A,B,C's. Each product is coming from a supplier and is part of a subcategory of products. If i have a table with all products I can see which product is A, which B and C. 

 

But I want to be able to have a table with all suppliers and then a measure to count how many A,B,C product I have for each supplier.

 

Current measure for Dynamic ABC is the following :

 

ABC Oms =
IF (
    HASONEVALUE ( D_Vare[Varenr] ),
    VAR SalesByProduct =
       
           
            CALCULATETABLE (
            ADDCOLUMNS (
                SUMMARIZE ( F_Butikssalg, D_Vare[Varenr] ),
                "@ProdSales", [Oms. kr.]
            ),
            ALLSELECTED ( D_Vare )
        )
    VAR AllSales =
        CALCULATE (
            [Oms. kr.],
            ALLSELECTED ( D_Vare )
        )
    VAR CurrentSalesAmt = [Oms. kr.]
    VAR CumulatedSales =
        FILTER (
            SalesByProduct,
            [@ProdSales] >= CurrentSalesAmt
        )
    VAR CumulatedSalesAmount =
        SUMX (
            CumulatedSales,
            [@ProdSales]
        )
    VAR CurrentCumulatedPct =
        DIVIDE (
            CumulatedSalesAmount,
            AllSales
        )
    VAR Result =
        SWITCH (
            TRUE,
            ISBLANK ( CurrentCumulatedPct ), BLANK (),
            CurrentCumulatedPct <= 0.8, "A",
            CurrentCumulatedPct <= 0.95, "B",
            "C"
        )
    RETURN
         Result
       
)
1 REPLY 1
amitchandak
Super User
Super User

@AlexandruP , Window function with small modification to this

Power BI Window function- Pareto Analysis, 80% of sales, Order by on Measure: https://www.youtube.com/watch?v=UVxiLc_AzSs

 

or

 

Power BI Window function- TOP N% with Others: https://youtu.be/rQElaRoPbUA

 

can help

 

or

https://www.daxpatterns.com/abc-classification/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.