Case 5: ABC analysis of customers

Not every customer needs the same attention. You give every customer its sales as a column and put it into class A, B or C, so the dashboard and slicers can filter by it.

In short: in the Customer table, SUMX(RELATEDTABLE(Orders), Orders[Amount]) calculates every customer's sales as a calculated column. A second column SWITCH(TRUE(), Customer[Customer Sales] >= 90000, "A", Customer[Customer Sales] >= 30000, "B", "C") assigns the class.

Task 1: sales per customer as a column

Task For the ABC classes every customer needs their sales as a fixed column. Create the calculated column "Customer Sales" in Customer: the sum of Orders[Amount] across all of the customer's orders.

Orders 221 rows, 5 columns
OrderIDDateCustomerIDRepIDAmount
10014 Jan 202510532850
100216 Jan 202510118730
100319 Jan 202510544650
10041 Feb 202510325210
100511 Feb 2025109511440
100611 Feb 202511162000
100711 Feb 202511323850
100812 Feb 202510325670
100913 Feb 202510427380
101013 Feb 202510958250
101116 Feb 202510117650
101221 Feb 202510126750

Showing the first 12 of 221 rows.

Measures: [Total Sales]

Customer 16 rows, 3 columns
CustomerIDCustomerIndustry
101Berg Engineering LtdManufacturing
102Northlight Trading CoRetail
103Harbor Logistics IncServices
104Crane Electric plcManufacturing
105Sunfield Markets LLCRetail
106Alpine Tools LtdManufacturing
107Riverside Consulting LLCServices
108Lakeside Print CoServices
109Rhine Steel IncManufacturing
110West End Fashion LtdRetail
111Valley Wine Merchants LLCRetail
112Midland Services LtdServices

Showing the first 12 of 16 rows.

SalesRep 6 rows, 3 columns
RepIDNameRegion
1Emma ClarkeNorth
2Tom WolfNorth
3Ravi PatelSouth
4Lucy EvansSouth
5Sam KerrWest
6Mia LangWest
Target 144 rows, 3 columns
DateRepIDTargetAmount
1 Jan 202517500
1 Feb 202517500
1 Mar 202517500
1 Apr 202517500
1 May 202519000
1 Jun 202519500
1 Jul 202519500
1 Aug 202517500
1 Sep 202517500
1 Oct 202519000
1 Nov 202519500
1 Dec 202519000

Showing the first 12 of 144 rows.

Measures: [Total Target]

Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

RELATEDTABLE goes from the one side to the many side of a relationship, as in the lesson on RELATED and LOOKUPVALUE. The lesson calculated column or measure? explains why a column is right here: a class should work as a row and as a slicer.

Task 2: the class

Task Put the customers into classes. Create the calculated column "Class" in Customer: "A" from 90,000 customer sales, "B" from 30,000, otherwise "C".

Orders 221 rows, 5 columns
OrderIDDateCustomerIDRepIDAmount
10014 Jan 202510532850
100216 Jan 202510118730
100319 Jan 202510544650
10041 Feb 202510325210
100511 Feb 2025109511440
100611 Feb 202511162000
100711 Feb 202511323850
100812 Feb 202510325670
100913 Feb 202510427380
101013 Feb 202510958250
101116 Feb 202510117650
101221 Feb 202510126750

Showing the first 12 of 221 rows.

Measures: [Total Sales]

Customer 16 rows, 4 columns
CustomerIDCustomerIndustryCustomer Sales
101Berg Engineering LtdManufacturing199620
102Northlight Trading CoRetail29330
103Harbor Logistics IncServices72580
104Crane Electric plcManufacturing97800
105Sunfield Markets LLCRetail94580
106Alpine Tools LtdManufacturing136310
107Riverside Consulting LLCServices26710
108Lakeside Print CoServices20940
109Rhine Steel IncManufacturing195580
110West End Fashion LtdRetail26560
111Valley Wine Merchants LLCRetail12760
112Midland Services LtdServices51440

Showing the first 12 of 16 rows.

SalesRep 6 rows, 3 columns
RepIDNameRegion
1Emma ClarkeNorth
2Tom WolfNorth
3Ravi PatelSouth
4Lucy EvansSouth
5Sam KerrWest
6Mia LangWest
Target 144 rows, 3 columns
DateRepIDTargetAmount
1 Jan 202517500
1 Feb 202517500
1 Mar 202517500
1 Apr 202517500
1 May 202519000
1 Jun 202519500
1 Jul 202519500
1 Aug 202517500
1 Sep 202517500
1 Oct 202519000
1 Nov 202519500
1 Dec 202519000

Showing the first 12 of 144 rows.

Measures: [Total Target]

Date 730 rows, 4 columns
DateYearMonthMonthName
1 Jan 202520251Jan
2 Jan 202520251Jan
3 Jan 202520251Jan
4 Jan 202520251Jan
5 Jan 202520251Jan
6 Jan 202520251Jan
7 Jan 202520251Jan
8 Jan 202520251Jan
9 Jan 202520251Jan
10 Jan 202520251Jan
11 Jan 202520251Jan
12 Jan 202520251Jan

Showing the first 12 of 730 rows.

This exercise is part of Premium.

Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.

See Premium Already Premium? Log in

The first exercise in this lesson is free.

The limits of 90,000 and 30,000 apply to sales across both years. SWITCH checks the highest limit first; otherwise every A customer would already stop at "B".

Common mistakes

A plain SUM in the column

SUM(Orders[Amount]) in a calculated column of Customer gives the sales of all customers in every row, because without CALCULATE or RELATEDTABLE the row does not become a filter.

Column in the wrong table

In Orders every row is an order, not a customer. The class belongs in the Customer table.

In real Power BI

  • Calculated columns are calculated when the data refreshes. The class therefore only changes after the next refresh, not with a slicer.
  • The classic ABC analysis by share of sales (A up to 80% of sales) needs a running total across the customers sorted by sales. Fixed limits keep it simpler and easy for the field team to follow.
  • You build the same analysis with formulas in the Excel case ABC analysis.

Check your result

  • Task 1: Berg Engineering Ltd has customer sales of 199,620, Cornerstone Catering Ltd 5,290.
  • Task 2: Five customers are A (down to Sunfield Markets LLC at 94,580), four are B (Harbor Logistics, Brightpath Software, Midland Services, Eastbridge Construction), seven are C.

Next: case 6, territory report

Every territory manager sees only their team, the title names the region, and shares refer to total sales.

Go to case 6

Back to case 4 or the course overview.

Write to us

Choose language

Select your preferred language