Forum Discussion
Anonymous
4 years agoNot applicable
Count unique values based on condition
Hi Guys, I have some order and production line data. What I want to do is for each production line I want to count the number of occurance of that production line in the table only if there is o...
- 4 years ago
Hi Anonymous ,
You can use a slicer for the Order.No, create a calculated table:
Table = DISTINCT('Data'[Production Line No.])A measure to count:
Count = CALCULATE ( COUNT ( Data[Order No.] ), FILTER ( ALLSELECTED ( Data ), 'Data'[Production Line No.] IN DISTINCT ( 'Table'[Production Line No.] ) ) ) + 0Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
| Order No. | Production Line No. |
| Order1 | A |
| Order1 | B |
| Order1 | C |
| Order2 | A |
| Order3 | A |
| Order4 | C |
| Order4 | D |
| Order4 | E |
| Order5 | A |
| Order6 | C |
| Order7 | D |
| Order8 | E |
| Order8 | D |
BeaBF
4 years agoSuper User
Anonymous Here two calculated columns to obtain your result:
COUNTT = CALCULATE(COUNT(Tabella[Order No.]), ALLEXCEPT(Tabella,Tabella[Order No.]))
TOTAL_ORDERS = IF(CALCULATE(SUM(Tabella[COUNTT]), Tabella[COUNTT] = 1) = BLANK(), 0, CALCULATE(SUM(Tabella[COUNTT]), Tabella[COUNTT] = 1))
Hope that's what you wanted!
B.
- Anonymous4 years agoNot applicable
BeaBF Thank you for the response. But we can not do it in a calculated column as the result should dynamically change based on the filters applied.