Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Community,
I have two tables, Table A (state, population) Table B (username, state).
Is there a way to setup RLS using username() to reference Table B(username) column to return the value of Table B(state) and join the data to Table A(state)?
On a separate but related question - Is there a way to assign a Parameter using UserName()?
Your help is much appreciated.
Solved! Go to Solution.
Hi there, you can most certainly do this.
I would suggest reading my blog post, which just gives some explanations around when deploying to the Power BI Service and what to look out for.
And then here is a great blog post by Kasper De Jonge, in which he gives a working example how to get RLS working. And also provides a sample PBIX file.
http://www.kasperonbi.com/power-bi-desktop-dynamic-security-cheat-sheet/
Hi there, you can most certainly do this.
I would suggest reading my blog post, which just gives some explanations around when deploying to the Power BI Service and what to look out for.
And then here is a great blog post by Kasper De Jonge, in which he gives a working example how to get RLS working. And also provides a sample PBIX file.
http://www.kasperonbi.com/power-bi-desktop-dynamic-security-cheat-sheet/
BTW, how come there's not a way to assign username() function within a parameter? If there's a way, I could restrict data at the import layer instead of at filtering layer to improve performance.
Any idea?
Hi there,
That is a by design feature and in order for RLS to work correctly, you always have to have the entire dataset.
This ensures that if you have a user who needs access to everything this can be achieved.
This also ensures that dynamic RLS can be achieved without having to re-create not only the charts but also the dataset.
If I understand you correctly you would want to only bring in the data for the specific user?
If that is the case you would then have to have a specific dataset per user, which would increase the size of each individual model.
By keeping all the data in one model and leveraging RLS ensures that the data is complete and consistent across the different users.
You addressed my concern perfectly. Thank you once again!
Hi
why i don't have (on the join) the option for “Apply security filter in both directions”...?
attach picture
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
79 | |
58 | |
35 | |
34 |
User | Count |
---|---|
99 | |
59 | |
56 | |
46 | |
40 |