Forum Discussion

v-sabenn's avatar
v-sabenn
Regular Visitor
8 years ago
Solved

Help with DAX formulas for Managing Roles via PBI Desktop

Hello,

 

I'm working on publishing reports that I want to apply security by geo via roles. I am having a hard time setting those up, so can someone help by walking me through how to do that? Thank you in advance.

  • Can you be more specific? 

     

    To create a role depends on how you want to create it. 

     

    For example, if you have several leaders that are responsible for say the USA and the field is called "Country" you can do this:

     

    1. Go to 'Manage Roles'

    2. Click 'Create Roles'

    3. Enter a name for the role say "HR Leaders - USA Access Only"

    4. Depending on how your data is laid out (if you have just one table), you can assign the permission to that one table or all of the tables by copy and pasting. 

    5. Assuming you have a country field, the DAX should be: [Country] = "USA" 

    6. Click 'Save'

     

    Now you can click "View Roles" and if you view your data as that role, only USA records should show. 

    Another example is that if someone has access to all countries but the USA you can do: [Country] <> "USA" and that person will see everyone but the USA. 

     

    Hope this helps!

2 Replies

  • Can you be more specific? 

     

    To create a role depends on how you want to create it. 

     

    For example, if you have several leaders that are responsible for say the USA and the field is called "Country" you can do this:

     

    1. Go to 'Manage Roles'

    2. Click 'Create Roles'

    3. Enter a name for the role say "HR Leaders - USA Access Only"

    4. Depending on how your data is laid out (if you have just one table), you can assign the permission to that one table or all of the tables by copy and pasting. 

    5. Assuming you have a country field, the DAX should be: [Country] = "USA" 

    6. Click 'Save'

     

    Now you can click "View Roles" and if you view your data as that role, only USA records should show. 

    Another example is that if someone has access to all countries but the USA you can do: [Country] <> "USA" and that person will see everyone but the USA. 

     

    Hope this helps!

    • v-sabenn's avatar
      v-sabenn
      Regular Visitor

      Thanks for the tips. In my reports, I do have visualizations of data from different tables. I'm wondering if I can create roles that limit access when there is more than one datasource utilized in the report? E.g. "US access" : [usercountry] = 'United States' AND [Area] = 'United States'

       

      Would that work?