cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
UM4R Frequent Visitor
Frequent Visitor

How to calculate number/percentage of customers who have purchased X amount of products

i have some data and i want to show in graph form to show the number of customers and how many different products they have purchased

 

example data below

 

ID

Product Purchased

1

A

2

A

2

B

3

A

3

B

3

C

4

A

5

B

5

C

 

 

Results

2 bought 1 product

 

2 bought 2 products

 

1 bought 3 products

 

thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to calculate number/percentage of customers who have purchased X amount of products

@UM4R

 

Try this calculated TABLE

 

From the Modelling Tab>>>NEW TABLE

 

Table =
SUMMARIZE (
    SUMMARIZE (
        TableName,
        TableName[ID],
        "No of Products", DISTINCTCOUNT ( TableName[Product Purchased] )
    ),
    [No of Products],
    "No of Customer", DISTINCTCOUNT ( TableName[ID] )
)

View solution in original post

4 REPLIES 4
ricardocamargos Established Member
Established Member

Re: How to calculate number/percentage of customers who have purchased X amount of products

Hi @UM4R,

 

You can use either DISTINCTCOUNT formula to calculate distinct products bought per customers or the quick measure COUNT (Distinct) by clicking on the arrow after drop the field on "Value".

 

If I understood what you wanna show, it's a dynamic segmentation, Marco Russo and Alberto Ferrari have a article about it: 

https://www.daxpatterns.com/dynamic-segmentation/

 

Thanks,

 

Ricardo

 

Super User
Super User

Re: How to calculate number/percentage of customers who have purchased X amount of products

@UM4R

 

Try this calculated TABLE

 

From the Modelling Tab>>>NEW TABLE

 

Table =
SUMMARIZE (
    SUMMARIZE (
        TableName,
        TableName[ID],
        "No of Products", DISTINCTCOUNT ( TableName[Product Purchased] )
    ),
    [No of Products],
    "No of Customer", DISTINCTCOUNT ( TableName[ID] )
)

View solution in original post

Super User
Super User

Re: How to calculate number/percentage of customers who have purchased X amount of products

@UM4R

 

Noofproducts.png

UM4R Frequent Visitor
Frequent Visitor

Re: How to calculate number/percentage of customers who have purchased X amount of products

thanks @Zubair_Muhammad  it has seemed to have done the trick 

 

@ricardocamargos thanks for the link, it has a lot of useful information will look in more detail when i have some free time

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 200 members 1,925 guests
Please welcome our newest community members: