Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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-123 | Customer A |
| A-123 | Customer B |
| A-123 | Customer C |
| A-123 | Customer D |
| B-456 | Customer B |
| B-456 | Customer B |
| B-456 | Customer A |
| B-456 | Customer A |
| C-789 | Customer B |
| C-789 | Customer C |
| C-789 | Customer C |
| C-789 | Customer A |
Below is example of the result I wish to get.
| Part # | # of Unique Customers |
| A-123 | 4 |
| B-456 | 2 |
| C-789 | 3 |
Solved! Go to Solution.
@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]) )
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.
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
@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]) )
Interesting! @amitchandak
I had similar approach where I tried to use
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |