How to do it...

  1. Load or connect to the user role table described in the Getting ready section, from a Power BI data model:
    • The user table should be hidden from the Fields List and should not have relationships to any other table
  2. Create DAX measures to return the user's role and sales territory values for group, country, and region:
User Principal Name = USERPRINCIPALNAME()User Sales Territory Key = LOOKUPVALUE('Sales User Roles'[SalesTerritoryKey],'Sales User Roles'[User Email Address],[User Principal Name])User Sales Role = VAR RoleLookup = LOOKUPVALUE('Sales User Roles'[User Role],'Sales User Roles'[User Email Address],[User Principal Name]) RETURN IF(ISBLANK(RoleLookup),"Role Not Found",RoleLookup)User Sales Group = IF([User Sales ...

Get Microsoft Power BI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.