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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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/

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors