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
cnpdx
Helper II
Helper II

Need list of customers with more than 1 purchase

I am trying to get a LIST of customers who had more than 1 purchase.

 

Below, you can see each customer has a unique code, so there are more jobs than distinct codes, as there are a few repeat customers. 

 

I was able to get the AGGREGATE data to show # of repeat customers, as you can see from this table. But when I try to add a row dimension to the table for customer name, it will not show the 30 customers who have more than 1 job. 

 

So, how do I get a table, with a list of customers specifically who had more than 1 job, to match the aggregate value already presented? thanks!

pbi jobs 3.6.17.JPG

 

Distinct Count of Customer Jobs = CALCULATE(DISTINCTCOUNT('SALES DETAILS'[Sales Customer Job])

Distinct Count of Customer Code = CALCULATE(DISTINCTCOUNT('SALES DETAILS'[Sales Customer Code])

Customer with more than 1 job = [Distinct Count of Customer Jobs]-[Distinct Count of Customer Code]

4 REPLIES 4
Phil_Seamark
Employee
Employee

Are you looking for a monthly list of customers with more than one job?  Or just over all time?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

thank you @Phil_Seamark

 

it has to be time sensitive. For example, the company is SaaS, customers are recurring monthly, so we are looking for customers within a given month who had more than one TRANSACTION. We can't count products, because there can be more than 1 product on an invoice and that's ok. So we are looking for customers in one month who had more than one TRANSACTION (aka more than one invoice).

Hi @cnpdx,

 

You can create a summarized table like below:

 

Table 2 = SUMMARIZE('Table5','Table5'[Year],'Table5'[Month],'Table5'[Customers],"CountInvo",COUNTA('Table5'[Invoices]))

Then drag values from the customer to the table visual, set Visual Level filter based on "CountInvo" is greater than 1. See:

 

 

q2.PNG

 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
danrmcallister
Resolver II
Resolver II

@cnpdx: how about this:

 

  • In your original data table, add a column that counts the # of sales made to any particular customer.  This will allow you to identify your repeat customers
  • Create a new "repeat customers" table that filters out any customers that are not repeat customers

 

Code to count individual sales per customer as a new calculated column:

 

#Sales = CALCULATE(
    COUNTROWS(Data),
    FILTER(Data,
        Data[Customer] = EARLIER(Data[Customer])
    )
)

Code to create a table that only includes repeat customers:

 

RepeatCustomers = DISTINCT(
    CALCULATETABLE(
        Data,
        Data[#Sales]>1
    )
)

Does this match what you're trying to do?  Here are some screenshots if those help.

 

PBI Repeat Customers 1.jpgPBI Repeat Customers 2.jpg

 

Dan

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.