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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
davehus
Memorable Member
Memorable Member

Count of sites not purchasing

Hi,

I want to work out how many of my customers are not buying from my suppliers for the current year when I select a filter.
I have a customer table which has customers from the last 2 years. When I write the measure it includes all the customers from table whether they have bought this year or not when I use the All function.

Any thoughts on how I can correct this.
1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@davehus,

 

Instead of ALL Function, check ALLSELECTED Function.

Community Support Team _ Sam Zha
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

7 REPLIES 7
v-chuncz-msft
Community Support
Community Support

@davehus,

 

Instead of ALL Function, check ALLSELECTED Function.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Share a dataset and show the expected result.


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

Hi,

 

Customer NameSupplierSales CY

Customer C

Supplier B1000
Customer ASupplier B 
Customer DSupplier B500
Customer BSupplier B

510

 

Expected result is to show that the supplier sells product to 75% of the customers in the sample table above. The part I'm struggling with is that their are customers in my Customer Table that haven't purchased this year and I want to exclude them from the evaluation. Hope this makes sense. 🙂

 

Thanks

Hi @davehus,

 

Try this formula

 

=COUNT(Table1[Sales CY])/DISTINCTCOUNT(Table1[Customer Name])

Hope this helps.


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

Hi Asish,

 

Thanks for this.

 

Sales CY is a measure and not a column. I'm currently using this logic to determine how many sites are supplied.

 

Delivery Points Supplied = CALCULATE(DISTINCTCOUNT(Customer[Customer Number]), FILTER(Customer, CALCULATE([Sales CY]>0))) - This works fine for me.

 

However when I write the measure to capture sites that are not purchasing from the selected supplier, it includes all my customers when I only want to return customers that have purchased this year.

 

Hope this makes sense.

 

PBIExample.JPG

Hi,

 

Share the link from where i can download the file and show the expected result there (actual figure which you are expecting the formula to return).


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

Hey,

 

w/o more information about the tables contained in your data model and how these tables are related it will become a little difficult to help you with any DAX statement either a measure or a calculated column.

 

Maybe this post addresses a similar requirement:

https://community.powerbi.com/t5/Desktop/How-to-build-a-white-space-report/m-p/269666#M121457

 

Hopefully this gets you started

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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