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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
AF_VK
New Member

Power BI RLS

Hi All,

I am stuck in one scannario related to RLS. I need to create dynamic RLS on the basis of supplier_ID and Receiver_ID

Below is the data and i have use report server (USERPRINCIPALNAME).

 

Date          Supplier ID               Receiver_ID              Item

202301     abc@hmx.com        xyz@hmx.com        hedphone

202301     xyz@hmx.com         abc@hmx.com       mouse

202301     xyz@hmx.com        lmn@hmx.co           Key

202301    xyz@hmx.com         xyz@hmx.com       Pen

202302    lmn@hmx.com        xyz@hmx.com        Hedphone

202302    xyz@hmx.com         abc@hmx.com        mouse

202302    xyz@hmx.com        lmn@hmx.com        key

202302   lmn@hmx.com        xyz@hmx.com        pen

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @AF_VK ,

 

Please try:

vjianbolimsft_1-1678758308674.png

Final output:

vjianbolimsft_0-1678758291043.png

Best Regards,

Jianbo Li

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-jianboli-msft
Community Support
Community Support

Hi @AF_VK ,

 

When you are  viewing as abc@hmx.com, As long as Supplier ID or Receiver_ID contains  abc@hmx.com, that line of data will be visible.

 

 [Supplier ID] = USERNAME()||[Receiver_ID] = USERNAME()

 This formula is used to filter the table, "||" means "or". Regardless of Supplier ID or Receiver_ID, as long as one of the two column contains xxxx, that row of data could be visible.

 

Best Regards,

Jianbo Li

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

AF_VK
New Member

Thanks Jianbo, actually i am new to RLS so one question when you are  viewing as abc@hmx.com ,is it supplier_id login or receiver_id login ? Also if you can explain the formula [Supplier ID] = USERNAME()||[Receiver_ID] = USERNAME() that would be great help. Thanks again for your reply 

v-jianboli-msft
Community Support
Community Support

Hi @AF_VK ,

 

Please try:

vjianbolimsft_1-1678758308674.png

Final output:

vjianbolimsft_0-1678758291043.png

Best Regards,

Jianbo Li

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.