Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
98 | |
81 | |
65 | |
62 |
User | Count |
---|---|
147 | |
116 | |
104 | |
88 | |
65 |