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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors