Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • v-yingjl's avatar
    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.] )
        )
    ) + 0

     

    Best 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.