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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
reddy6400
Frequent Visitor

Dynamic Row Level Security-with Distinct Location ID

Hi All,

Please suggest how to implement Dynamic Row Level Security for my below scenario.

 

I have 2 tables.One is main report data table(sales by Location) and 2nd table is Location table.

My 2nd table has multiple Location Id's.I have to select Distinct location for the Email user and join that Location Id to the main data table to show the data in  a repor With out duplicate records.

 

Below is the screen shot.

Thank in Advance.

Raj

100.JPG

 

 

6 REPLIES 6
nandukrishnavs
Community Champion
Community Champion

@reddy6400 

 

You have to create a relationship between two tables using the Location ID column.

 

Table2[Location Id] many to one Sales_by_Location[Location Id] (Both direction)

 

Relationship.JPG

 

Then create a Role in Table2.

 

[Email] = userprincipalname()

role.JPG

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

Here is my latest blog

https://community.powerbi.com/t5/Community-Blog/Dynamic-Page-Navigation-Based-on-User-Login/ba-p/109...


Regards,
Nandu Krishna

@nandukrishnavs 

 

Sorry,Data in SALES_BY_LOCATION has same multiple Location ID's.
I have mutile Location ID's in both the tables(many to many).

I have to get distinct Location ID from Table 2 and join to table1.

@nandukrishnavs ..Getting below error when i join both the tables.

 

reddy6400_0-1596227537317.png

 

@reddy6400 

 

What is the error message?

 

if your location id and sales combination is repeating, you can select both column and remove duplicate. If the sales values are different, then you can group by location id. (Edit Query)


Regards,
Nandu Krishna

@nandukrishnavs 

 

When i drag Email ID(Table-2) to the report.It is giving me below error.

 

reddy6400_0-1596249433578.png

 

@reddy6400 

Click on see details, and see what is the error message.


Regards,
Nandu Krishna

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors