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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
RossS
New Member

Calculate total sales per customer and exclude certain customers

Hello,

 

I would like to create a column or measure that first caluclates the total sales for each customer, but then excludes certain customers.

 

AmountCustomer_no
£865.40John
£656.00Harry
£223.67Harry
£12,233.89John
£23,423.87Rachel
£767.34Rachel

 

If all information is stored in the same table, and i wanted to know the total sales for all customers, but exclude John, how would I write that?

 

The table is named Customer_Ledger_Entries_Excel.

I believe I would start with CALCULATE(SUM(Customer_Ledger_Entries_Excel[Amount]),

 

2 REPLIES 2
anmolmalviya05
Super User
Super User

Hi @RossS , please try below measure:

Total Sales (Excluding John) =
CALCULATE(
SUM(Customer_Ledger_Entries_Excel[Amount]),
Customer_Ledger_Entries_Excel[Customer_no] <> "John"
)

Thank you for this.

 

Can I also please ask, if I want to exclude data in the column that contains certain values, such as data that contain '0', how can I do this?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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