Monday, November 9, 2026

Calculate customers whose sales are above average customer sales.

 First we need Total Sales Amount 

Sales Amount = SUM(Sales[SalesAmount])

Then we need to calculate Average Sales Amount
If we use below formula, it will give us the average. But we want to compare this average with sales amount of each customer. This average will change for each row as it operates on row context
DIVIDE([Sales Amount], DISTINCTCOUNT(Customers[CustomerName]), 0)

Hence we use below formula:
Avg Sales = AVERAGEX(ALL(Customers[CustomerName]), [Sales Amount])

Now, we need a flag which states if the Sales Amount is greater than Avg Sales

Above Avg Customer = IF([Sales Amount] > [Avg Sales], 1, 0)

In the table visual we can display CustomerName, SalesAmount. In Visual Filter we can add "Above Avg Customer = 1" and apply filter





No comments:

Post a Comment