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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JustSayJoe
Advocate IV
Advocate IV

Using Distinct Count on multiple columns

TableA contains:

  • Email
  • Product ID

Some emails only order 1 product, while others order multiple products.

 

I want to display a visual showing the various distinct counts of the Product ID column on the Y-Axis, and the distinct count of Emails on the X-Axis. Basically I want to show how many different Emails have ordered 1 product, 2 products, 3 products, etc.

 

How do I accomplish this?

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @JustSayJoe 

 

Download example PBIX file

 

In Power Query 

 

Starting with this data

 

grps1.png

 

 

Group the Email column using the Distnict Count of the Product column

 

grps2.png

 

Then group the Email column by the Distinct Count of the Email coumn

 

grps3.png

 

Plot that data, Number of Products needs to be on the x-axis

 

prods.png

 

You can see that

 

1 product was bought by 1 email

4 products were bought by 2 emails

5 products were bought by 2 emails

7 products were bought by 1 email

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @JustSayJoe 

 

Download example PBIX file

 

In Power Query 

 

Starting with this data

 

grps1.png

 

 

Group the Email column using the Distnict Count of the Product column

 

grps2.png

 

Then group the Email column by the Distinct Count of the Email coumn

 

grps3.png

 

Plot that data, Number of Products needs to be on the x-axis

 

prods.png

 

You can see that

 

1 product was bought by 1 email

4 products were bought by 2 emails

5 products were bought by 2 emails

7 products were bought by 1 email

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.