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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
corange
Post Patron
Post Patron

ABC Analysis

Hi everyone, I am trying to integrate the ABC Classfication in Power BI, however, I am struggling with how to integrate filters. This is the formula I have used:

 

Amount ABC =

var Outer =

ADDCOLUMNS(

    VALUES(Jobs_Details[CLIENT_CODE]),

    "OuterValue", [Gross Profit]

)

var Inner  =

ADDCOLUMNS(

    ALL(Jobs_Details[CLIENT_CODE]),

    "InnerValue", [Gross Profit]

)

return

CALCULATE(

    [Gross Profit],

    VALUES(Jobs_Details[CLIENT_CODE]),

    FILTER(

        CALCULATETABLE(

            ADDCOLUMNS (

                Outer,

                "CumulatedPercentage", DIVIDE (

                    SUMX (

                        FILTER (

                            Inner,

                            [InnerValue] >= [OuterValue]

                        ),

                        [InnerValue]

                    ),

                    CALCULATE (

                        [Gross Profit],

                        VALUES (Jobs_Details[CLIENT_CODE])

                    )

                )

            ),

            ALL(Jobs_Details)

        )

        , [CumulatedPercentage] > CALCULATE( MIN('ABC Class'[LowerBoundary]) )

        && [CumulatedPercentage] <= CALCULATE( MAX('ABC Class'[UpperBoundary]) )

    )

)

The issue is that when I select another filter such as a Rate Table Number so I could see all Class A client that uses a specifc pricing strategy, it will grouped all client under Class A while originally without that filter selected, the client is a Class C. Moreover, when I try to look for a specific client using the search function, I can see the client is duplicate with only information attached to one Class however, it is the wrong class too. Any idea how to fix this so it is dynamic no matter which filter is used? Thank you.

4 REPLIES 4
v-yuta-msft
Community Support
Community Support

@corange ,

 


The issue is that when I select another filter such as a Rate Table Number so I could see all Class A client that uses a specifc pricing strategy, it will grouped all client under Class A while originally without that filter selected, the client is a Class C. Moreover, when I try to look for a specific client using the search function, I can see the client is duplicate with only information attached to one Class however, it is the wrong class too. Any idea how to fix this so it is dynamic no matter which filter is used? Thank you.


I'm quite confused on your description. could you share more details about this issue? (e.g.: relationship between Rate Table and Fact table, which column are you trying to divide and what does the search expression look like)

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, 

 

THanks for your reply. 

 

Can I share my document with you privately somehow? 

@corange ,

 

Please do not sent the orginal file. You can make a simple sample file, upload the file to onedrive and share the link here.

 

Regards,

Jimmy Tao

amitchandak
Super User
Super User

Refer if this can help

https://community.powerbi.com/t5/Desktop/ABC-Analysis/td-p/309108

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

https://exceed.hr/en/blog/dynamic-abc-analysis-in-dax-variables

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.