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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Blaggy
Helper II
Helper II

Calculate Distinct Count of Customers with Certain Product Combinations

I feel like I'm very close to solving this, but I have been going in circles for hours, so figured best to ask someone who actually understands DAX 😀.

 

Below is some sample data in a table that I imported into Power BI.

 

I can get an appropriate view of the distinct count of customers that have Revenue in certain quarters by Product and in total and when filtering by quarter (example snapshots below): 

 

Blaggy_0-1708998336442.png

 

Blaggy_1-1708998386751.png

 

To get this, I'm doing a matrix with customer and the below Measure:

 

Count of Products Owned by Customer = CALCULATE(
                        DISTINCTCOUNT('Sample'[Customer Name])
                    )
 
Blaggy_2-1708998986516.png

 

 Simple so far, but what I want to do now is show the number of customers that ONLY own a certain product and no other products, such as those that only own Product A in 24Q1, which would be 3 (Customers 2, 4 and 14). 
 
I also want to show the number of customers that have certain product combinations of products, such as Customers that have Products B and C only (again using 24Q1 as an example), which would be 2 (Customers 12 and 13).
 
How do I go about showing these as new Measures (using examples above, have a "Product A Only Customer Count" measure, and a "Products B and C Customer Count" measure)?

 

This seems like it would be incredibly easy, but I cannot seem to figure it out.

 

Source Table:

 

Customer NameProduct22Q122Q222Q322Q423Q123Q223Q323Q424Q1
Customer 1Product A125,736135,712.41101,553.21101,553101,553101,553101,541101,541101,541.30
Customer 1Product C31,964.6831,964.6831,964.6831,613.5531,613.5531,613.5531,613.5535,00035,000
Customer 1Product D709        
Customer 2Product A   9,9459,9459,9459,9459,94511,475.03
Customer 2Product C16,000.0016,000.0016,000.00      
Customer 3Product A9,651.549,651.549,651.54      
Customer 3Product B35,915.0472,817.3345,659.0445,659.0445,659.0445,659.0445,659.0445,659.0445,659.05
Customer 4Product A84,229.9383,219.5383,219.5383,219.5383,219.5383,219.5383,219.5383,219.5383,219.53
Customer 4Product D 3,258.693,258.693,258.693,258.693,258.69   
Customer 5Product A121121 125.66125.66125.66 131.93131.93
Customer 5Product D139.33139.33139.33139.33139.33139.33139.33139.33139.34
Customer 6Product D506.24506.24506.24506.24506.24506.24506.24506.24506.24
Customer 7Product A17,28017,28017,28010,00910,00910,00910,009.44  
Customer 8Product A13,717.3713,717.3713,717.3713,717.3713,717.3713,717.3713,717.3713,717.3713,717.37
Customer 8Product B2,7302,7302,7302,7302,7302,730   
Customer 8Product C29,938.4729,938.4729,938.4729,938.4729,938.4729,938.4729,938.4729,938.4729,938.47
Customer 8Product D137,360.00137,360.00137,360.00137,545.69137,545.69137,545.69137,545.69127,968.00211,822.01
Customer 9Product C6,360.796,360.796,360.798,206.828,206.828,206.828,206.828,206.828,206.82
Customer 9Product D13,967.1413,967.1413,967.1413,967.1415,106.8715,106.8715,106.8715,106.8715,106.87
Customer 10Product D511.54511.54511.54511.54     
Customer 11Product D      389.1389.1389.1
Customer 12Product B557.68557.68557.68557.68557.68557.68557.68557.68557.68
Customer 12Product C1,372.071,372.071,372.071,372.071,372.071,372.071,372.071,372.071,372.07
Customer 13Product B    7,037.767,037.767,037.767,037.767,037.76
Customer 13Product C    5,000.005,000.005,000.005,000.005,000.00
Customer 14Product A75,93075,93074,03174,03174,03174,031106,877106,877106,877
Customer 14Product D1,212.551,212.55       
Customer 15Product C3,279.093,279.093,581.443,581.443,581.443,581.443,760.493,760.493,760.51
1 ACCEPTED SOLUTION

You are welcome.  Attached now.


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

View solution in original post

5 REPLIES 5
Blaggy
Helper II
Helper II

Thanks for the quick work on the first part - playing with that now, and looks like it works.  I haven't used the "Summarize" function before, so I would not have figured this out.  Looking forward to your magic on part 2 of the question!

You are welcome.  I have solved a similar problem in the attached file.  3 at the intersection of A1 and A1 tells you that 3 students answered question 1.  2 at the intersection of A1 and A2 tells you that of those 3 students, 2 also answered question 2.

Ashish_Mathur_0-1709019227207.png

 


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

Thanks, @Ashish_Mathur, but I don't see an attachment on this one.

You are welcome.  Attached now.


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

Hi,

In the attached file, you will find the answer to your first question.

Hope this helps.

Ashish_Mathur_0-1709002547514.png

 


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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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