Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
v-sabenn
Regular Visitor

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.

1 ACCEPTED SOLUTION
sokatenaj
Helper III
Helper III

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!

View solution in original post

2 REPLIES 2
sokatenaj
Helper III
Helper III

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!

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?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.