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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JustSayJoe
Advocate II
Advocate II

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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