Forum Discussion
Count unique item codes per order id
Hi Fam,
I have a table matrix where the item codes are sorted by the order id.
I need to know how many unique items are received per order id.
In the example above, the total items are 16 but only 8 are unique items. I need to know how many unique item codes are sent per order.
Example:
1st order = 5 unique items
2nd order = 10 items sent but 5 were part of the 1st order, so only 5 are unique.
3rd order = 3 items sent but 2 were already part of 1st and 2nd order, so only 1 us unique.
Andrew_na_lang , Try this measure:
MEASURE = CALCULATE(DISTINCTCOUNT(TableName[Item No]),ALLEXCEPT(TableName,TableName[OrderID]))
2 Replies
- AnonymousNot applicable
Hi,
It would be easier to give suggestions and solutions, if we knew your desired output format and had a table format of your sample data 🙂
Check out the sections in the following link:
- Include Your Expected Result- When posting data, put it in a nice format
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447595#M607169 - Tahreem24
Super User
Andrew_na_lang , Try this measure:
MEASURE = CALCULATE(DISTINCTCOUNT(TableName[Item No]),ALLEXCEPT(TableName,TableName[OrderID]))