Forum Discussion

SACooper's avatar
SACooper
Icon for Helper II rankHelper II
4 years ago
Solved

Dynamic Measure, show data based on usertpe

I have a user_mappings table which lists various different pieces of infomation about users of a system, such as AD loginname, email, userprinciplename (from ad), their manager, and if they are a man...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi SACooper ,

    My test table:

     

    User_Mapping:

     

    Product:

     

    Mode:

    Try below measure:

     

    Procuet_Fruit =
    VAR cur_email =
        SELECTEDVALUE ( User_Mapping[Email] )
    VAR cur_isManager =
        SELECTEDVALUE ( User_Mapping[IsManager_num] )
    VAR cur_upn =
        USERPRINCIPALNAME ()
    RETURN
        IF (
            cur_email = cur_upn
                && cur_isManager = 1,
            CALCULATE (
                MAX ( 'Product'[Fruit] ),
                FILTER ( 'Product', 'Product'[Email] = cur_email )
            ),
            BLANK ()
        )
    

     

     

     

    Best regards,
    Community Support Team_ Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.