Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I've been searching about RLS for some time now and I couldn't find a way to filter data based on location column.
So basically i need a dynamic RLS which will see the user's location when he/she will login. I have a user table which have email, names, office location, job title.
Cheers
Hi @Anonymous
Normally RLS is used with email id.
However, in your case Wit will depend on kind of location data do you have. (Country, state, county, zip)
Assuming you have the zipcode then access the user's zip code using the below site or use use a site as per your convinience and company standards.
My Zip Code - What is My Zip Code? (my-location.org)(I used google to get this)
Save this zipcode as a datasource and use it to setup your RLS.
Hope this helps.
Hi Pranit,
I don't have zip code. in the office location we have cities such as Sydney, Queensland or melb. Is there a way to tackle this?
Hi @Anonymous ,
Unfortunately, there are no DAX expressions like USERNAME() to get the user's location information.
Is it true that the same user, logged in different regions will get different data results? If so, there may be no way to achieve that. You can suggest your idea on power bi ideas.
If not, you might consider creating a region table. The region table contains the location and what data can be viewed. The user table (the table you mentioned above) controls the region table and the region table controls the underlying data table, see this article for details.
https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi
Or, you can create many roles and add members in these roles in power bi service. These members can be a group (Distribution Group,Mail-enabled Group,Security Group). Users from different locations are added to different groups. By doing this to implement location-based RLS.
Row-level security (RLS) with Power BI - Power BI | Microsoft Docs
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |