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
rajulshah
Super User
Super User

Dynamic filtering of values for RLS

Hello All,

 

Requirement: If a user is present in the table, table should filter down. But if the user is not present in the table, I want to show all the users. User will login and see the reports. Hence, the user is a signed in user into Power BI Service.

 

Hence, I want dynamic filtering for RLS.

 

Anyone can help would be a great help to me.

 

Thanks in advance.

1 ACCEPTED SOLUTION

hi,@rajulshah

    After my research, I'm afraid it is difficult to achieve in Power BI for now.

advanced editor in power query is used to deal with the data source, and it couldn't filter data by credential that

log in Power BI service.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi,@rajulshah

  you can use USERNAME() or UserPrincipalName() function to to use Dynamic row level security in Power BI like below:

ISBLANK(COUNTROWS(filter(Table1,Table1[Name]=USERNAME())))

For example:

this is my basic data

2.PNG

and i add two roles by this formula

3.PNG4.PNG

Then i view as the roles

Assuming  that i am Wave3 

6.PNG

 

Assuming  that i am Wave9

7.PNG

 

Reference:http://radacad.com/dynamic-row-level-security-with-power-bi-made-simple

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-lili6-msft,

 

Thank you for the reply. I have this approach as a back-up.

 

What we want is to filter the data in the advanced editor using function like 'USERNAME', i.e. functon like these in power query.

 

Do you have any suggestions or links that I can follow?

hi,@rajulshah

    After my research, I'm afraid it is difficult to achieve in Power BI for now.

advanced editor in power query is used to deal with the data source, and it couldn't filter data by credential that

log in Power BI service.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.