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 re...
  • vojtechsima's avatar
    4 years ago

    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