Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

New Column with Max Value

Hello,   I trying to create a new cloumn for the employees to be contacted. the conditions if the employee belongs to a team. we will contact only one person randomly from that team if the emplo...
  • mahoneypat's avatar
    5 years ago

    Here is a calculated column expression with one way to do it to get the result below.  It isn't random but gets the first name alphabetically for each team.

     

     

    Contact =
    VAR thisemployee = Teams[Employee]
    VAR firstemployee =
        CALCULATE (
            MIN ( Teams[Employee] ),
            ALLEXCEPT (
                Teams,
                Teams[Team]
            )
        )
    RETURN
        IF (
            Teams[Team] = "",
            Teams[Employee],
            IF (
                thisemployee = firstemployee,
                firstemployee,
                BLANK ()
            )
        )

     

    Regards,

    Pat