DAX to Calculate distinct customers matching our criteria

Scenario :

  • We are an intermediary and we sell products of different vendors to customers
  • We have orders table where vendor name, customer name, and other information related to orders is available

Requirement :slight_smile:

  • We want the count of customers where we have sold 5 or more vendors. It means if we have sold products of 5 or more vendors to customer, want count of that customer, like how many are the customers meeting this criteria.

Workings Done.

I have tried to use calculate function but it is not showing any data.

Below is the DAX
CALCULATE([No. of Unique Customers],FILTER(History_OH,[Vendor Distinct Count]>=5))

Can any one please guide how to cater this requirement using DAX?

You can tackle this directly in Power Query by creating a new Reference Table from the Orders Table and using the Group By Function on Customer Column and Distinct Count on Vendor columns.

Hi @hasnainakram94 did the response provided by @pranamg help in solving your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query.

Hi @hasnainakram94, we’ve noticed that no response has been received from you since a few days ago.

We just want to check if you still need further help with this post?

In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

this solution provided is in power query but as per my scenario, i will need it to be done on DAX. So currently, I am still looking for answers

Hi @hasnainakram94, have you checked these videos by Sam McKay in the Business Analytics module in the Learning Center?

Find Lists Of Your Top Clients Across Different Measures w/DAX in Power BI (enterprisedna.co)

Find Your Top Customers Through Time Using RANKX in Power BI wDAX (enterprisedna.co)

Discover Top Salespeople Contribution To All Sales in Power BI w/DAX (enterprisedna.co)

Hi @hasnainakram94 - Share a sample PBIX file to help further.

Thanks
Ankit J

share the pbix file with sample data

Hi @hasnainakram94, due to inactivity, a response on this post has been tagged as “Solution”. If you have a follow question or concern related to this topic, please remove the Solution tag first by clicking the three dots beside Reply and then untick the check box.