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
Anonymous
Not applicable

Unique number of customers

Hi

I've trying to achieve the following requirement.

I've a table of Part numbers and customers who bought those part numbers. I wish to create a table that contains unique part numbers and next to it, number of unique customers per part number.

 

Below is example of the data:

Part #Customer
A-123Customer A
A-123Customer B
A-123Customer C
A-123Customer D
B-456Customer B
B-456Customer B
B-456Customer A
B-456Customer A
C-789Customer B
C-789Customer C
C-789Customer C
C-789Customer A

 

Below is example of the result I wish to get.

 

Part ## of Unique Customers
A-1234
B-4562
C-7893
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can create a measure

distinctcount(Table[Customer])

 

And use that in visual with item #

 

Or create a new tbale

summarize(table, Table[Item #], "Cust", distinctcount(Table[Customer])  )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
TheoC
Super User
Super User

Hi @Anonymous 

 

You can use Measure = DISTINCTCOUNT ( Table[Customer] ) to achieve this.  Just create a table with Part # on left and the new measure on the right.

 

In addition to the above, you can simply have the Table visual with the Part Number on the left, then drag the Customer field on the visual as well.  Click the down arrow on Customer, then click on Count (Distinct).  This will achieve the same outcome without any code.

 

TheoC_0-1643943557301.png

 

Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

amitchandak
Super User
Super User

@Anonymous , You can create a measure

distinctcount(Table[Customer])

 

And use that in visual with item #

 

Or create a new tbale

summarize(table, Table[Item #], "Cust", distinctcount(Table[Customer])  )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Interesting! @amitchandak 

I had similar approach where I tried to use 

VALUES('table'[Item #]) instead of Table[Item #]
So, does Table[Item #] return unique values when using Summarize?
 

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.