Forum Discussion

EB09's avatar
EB09
Frequent Visitor
2 years ago
Solved

Measure counting distinct values with condition

Hi,    I'm having trouble trying to create a new column in my table.    I have several person ID's in the same table, but I only want to count it once for each FY (financial year).    I need a ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi EB09 

     

    First you need to add the index column in the Power Query editor as shown below.

     

     

    Then You can create a measure as follows.

     

     

     

    result =
    VAR _min =
        CALCULATE (
            MIN ( 'Table'[Index] ),
            ALLEXCEPT ( 'Table', 'Table'[Person ID], 'Table'[FY] )
        )
    RETURN
        IF ( SELECTEDVALUE ( 'Table'[Index] ) = _min, 1, 0 )

     

     

     

    Is this the result you expect?

     

     

    Best Regards,

    Community Support Team _Yuliax

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.