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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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