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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Geniebelle123
New Member

Count of Customers with no Sales

Hello Experts,

 

I need to create a card that show the Count of Customers with no Sales filtered by date and brand. I tried the following measure

 

No of Customers with no Sales =
CALCULATE(
COUNT(Customer[Customerid]),
FILTER(salesinvoices,[Count of Sales invoice]=0)
)
 
But it always show blank.
 
Thanks all in advance~
 
This is my sample data.
Sales Invoice
Customer IDTotal AmountDateSales Invoice ID
A10043101ID1
B20043133ID2
30043134ID3
D40043194ID4
    

 

 Invoice Line
Invoice Line IDSales Invoice IDBrand 
LINE1ID1Brand A
LINE2ID2Brand B
LINE3ID3Brand A
LINE4ID4Brand B
LINE5ID1Brand A
LINE6ID2Brand B
LINE7ID3Brand A
LINE8ID4Brand B

 

Customer
Customer ID
A
B
D
E
1 ACCEPTED SOLUTION

Hi @Geniebelle123

 

You may create the measures as below and change the relationships. Attached the sample file.

Measure =
IF (
    NOT ( MAX ( Customer[Customer ID] ) ) IN VALUES ( 'Sales invoice'[Customer ID] ),
    1
)
Customers with no sales = SUMX(Customer,[Measure])

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

Based on the data you have shared, please let us know the exact result you are expecting and rationale for the same.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur

 

This is my expected result!

expected result.PNG

 

 

Thanks

Hi @Geniebelle123

 

You may create the measures as below and change the relationships. Attached the sample file.

Measure =
IF (
    NOT ( MAX ( Customer[Customer ID] ) ) IN VALUES ( 'Sales invoice'[Customer ID] ),
    1
)
Customers with no sales = SUMX(Customer,[Measure])

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, this works when comparing all customers in the customers table however I need to filter out the customers table to consider only the customers who have bought in the last one year. How can I go around this?

v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Geniebelle123

 

Could you show us the measure [Count of Sales invoice] you created? Please show the relationships. If you could share the .pbix file, we could provide an accurate solution. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.