Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Assign UserPrincipalName and ID

Dear All,

Im trying to create a measure that assigns matches the current userprincipalname with an ID table and returns the ID instead of the UserPrincipleName.

 

Anyone has any tips? 

 

Kind regards & thank you

  • Hi, Anonymous 
    depends on the exact structure of your model, but maybe a simple MAXX function can do it for you:

    getID = 
    var currentPrincipal = USERPRINCIPALNAME()
    return MAXX(FILTER('IDs', 'IDs'[email] = currentPrincipal), IDs[ID])



  • Anonymous's avatar
    Anonymous
    4 years ago

    Thank you, worked good

2 Replies

  • Hi, Anonymous 
    depends on the exact structure of your model, but maybe a simple MAXX function can do it for you:

    getID = 
    var currentPrincipal = USERPRINCIPALNAME()
    return MAXX(FILTER('IDs', 'IDs'[email] = currentPrincipal), IDs[ID])



  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you, worked good