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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
leilei787
Helper II
Helper II

Dynamic RLS Question

Keeping the question simple.....I have a dashboard that allow territory manager to see the whole region. I want to use territory table in our SFDC to do the dynamic RLS. However, in SFDC, each territory can only see their own territory and account. What can i do? 

 

More detail below: 

 

Happy Friday Everyone....i have questions about creating dynamic RLS using our SFDC report

 

I have a powerbi dashboard that allows Territory manager and Regional manager to see their own region. (Not specific Account or own territory. For example, territory managers in 1101, 1102, 1103 can all see Appalachian region. They can see each other but can not see other regions ). This report is currently using manual method to add new hire or make changes. it works fine. 

 

i want to leverage our Salesforce to create Dynamic RLS...but i am having trouble to setup the logic. Specifically the territory table in SFDC filters individual territory numbers (see below)......for example, if the territory manager in 1101 log into PBI, the territory table will filter 1101 which then point to Appalachian (connected through territory manager ID) in the Geo Mapping Table ( which connected to the main shipping table).......But is shipping report going to allow territory manager in 1101 to see the whole Appalachian? (My feeling is that it will not, only show 1101 individual territory) if not....should i connect Region field in territory table to the Region field in the Geo map table? that will become many to many relationship....will it work?

 

leilei787_0-1663362032577.png

 

Here are the sample tables ( And sample data at the end)

 

Table one: Shipping Detail ----- this report has all shipping data such as order date, Customer name, Territory number, Item and $$

Table two: Geo Map Transition ---- this report has Geo mapping such as territory number, Region number, names, etc

Table Three: Territory SFDC----- this report is from our SFDC which has territory info such as ID, name, TM ID, Region name, TM username, AD username, etc

 

this is how each table is linked:

leilei787_0-1663348845820.png

Using userprincipalname()

leilei787_1-1663348918183.png

 

Shipping table data

OrderDateCust #Cust NameCust ZipTerritory IDTerriotory NameItemTotal
1/6/20214224Intersection46621202Quincy JonesPencil189.05
1/23/2021524455Nevsky Cop980221203Johan RamsayBinder999.5
2/9/20212445Perspective Korp909431201William JardinePencil179.64
2/26/20212434In touch453451102Avtar GillPen539.73
3/15/20215324Driveway242521401Paul SorvinoPencil167.44
4/1/20214553Magnet245531202Quincy JonesBinder299.4
4/18/20215335Nori145661101Andrews McmeelPencil149.25
5/5/20215634Nardis743561201William JardinePencil449.1
5/22/20216345LG322221402Emma ThompsonPencil63.68
6/8/20216433IBM785541202Quincy JonesBinder539.4
6/25/20213566Infosys356781301Morgan FreemanPencil449.1
7/12/20218964Blue Star345671103Howard HewettBinder57.71
7/29/20218558Philips634631302Tyron WallerBinder1619.19
8/15/20214478walmart357851202Quincy JonesPencil174.65
9/1/202147643Amazon755671303Joseph SmithDesk250
9/18/202123567Cvs Health845731202Quincy JonesPen Set255.84
10/5/202127684Mckesson687651301Morgan FreemanBinder251.72
10/22/202145453Microsoft467851202Quincy JonesPen575.36
11/8/202124568ATT756441302Tyron WallerPen299.85
11/25/202145435Tmobile456741203Johan RamsayPen Set479.04
12/12/2021456456Sprint856741303Joseph SmithPencil86.43
12/29/20215565Comcast854571302Tyron WallerPen Set1183.26
1/15/202234343Kroger454561102Avtar GillBinder413.54
2/1/202222435Cigna467861303Joseph SmithBinder1305
2/18/20224546Costco956541202Quincy JonesBinder19.96
3/7/20225655UPS563261401Paul SorvinoBinder139.93
3/24/202243356Fedex336761201William JardinePen Set249.5
4/10/202234356USPS865661101Andrews McmeelPencil131.34
4/27/20223567HD457851103Howard HewettPen479.04
5/14/2022788355Lowes967551102Avtar GillPencil68.37
5/31/2022744907Ford578551102Avtar GillBinder719.2
6/17/2022457980Tesla855581203Johan RamsayDesk625
7/4/202257809Toyota467681202Quincy JonesPen Set309.38
7/21/202234354Honda876561301Morgan FreemanPen Set686.95
8/7/2022446576Verizon756541203Johan RamsayPen Set1005.9
8/24/2022346789GM764431401Paul SorvinoDesk825
9/10/2022453368IBM745781102Avtar GillPencil9.03
9/27/2022677899HP856441401Paul SorvinoPen151.24
10/14/202245779Boeing543551402Emma ThompsonBinder1139.43
10/31/20227899Intel234531101Andrews McmeelPencil18.06
11/17/202256799Pfizer323251201William JardineBinder54.89
12/4/2022566899State Farm244531201William JardineBinder1879.06
12/21/20226447878Humana785641101Andrews McmeelBinder139.72

 

Geo Map Translation Data

Territory IDTerritory NameRegion IDRegion NameRegion ManagerArea
1101Andrews Mcmeel1100AppalachianZiggy VuEast
1102Avtar Gill1100AppalachianZiggy VuEast
1103Howard Hewett1100AppalachianZiggy VuEast
1201William Jardine1200CaliforniaYahya WalshWest
1202Quincy Jones1200CaliforniaYahya WalshWest
1203Johan Ramsay1200CaliforniaYahya WalshWest
1301Morgan Freeman1300SoutheastGage FosterEast
1302Tyron Waller1300SoutheastGage FosterEast
1303Joseph Smith1300SoutheastGage FosterEast
1401Paul Sorvino1400SouthwestBeth CouchWest
1402Emma Thompson1400SouthwestBeth CouchWest

 

Territory SFDC data

 

Territory IDRegion__cTerritory_Manager__cRegion_Manager__cRegion NameTM NameTM UsernameRM Username
1101a0N6100000uMkXPEA000561000001pY2hAAE00561000001gIDfAAMAppalachianAndrews McmeelAndrews.Mcmeel@msn.comZiggy.Vu@msn.com
1102a0N6100000uMkXPEA000541000002KUYXAA400561000001gIDfAAMAppalachianAvtar GillAvtar.Gill@msn.comZiggy.Vu@msn.com
1103a0N6100000uMkXPEA00054N000005Y2Q1QAK00561000001gIDfAAMAppalachianHoward HewettHoward.Hewett@msn.comZiggy.Vu@msn.com
1201a0N6100000uMkXPEA000561000001KUYXAA400561000001gIDfAAMCaliforniaWilliam JardineWilliam.Jardine@msn.comYahya.Walsh@msn.com
1202a0N6100000uMkXPEA0005610000032fqPAAQ00561000001gIDfAAMCaliforniaQuincy JonesQuincy.Jones@msn.comYahya.Walsh@msn.com
1203a0N6100000uMkXPEA000563000002KUYXAA400561000001gIDfAAMCaliforniaJohan RamsayJohan.Ramsay@msn.comYahya.Walsh@msn.com
1301a0N6100000uMkXPEA000561000003oYUDAA200561000001gIDfAAMSoutheastMorgan FreemanMorgan.Freeman@msn.comGage.Foster@msn.com
1302a0N6100000uMkXPEA000761000001pY2hAAE00561000001gIDfAAMSoutheastTyron WallerTyron.Waller@msn.comGage.Foster@msn.com
1303a0N6100000uMkXPEA00054N000004Y2Q1QAK00561000001gIDfAAMSoutheastJoseph SmithJoseph.Smith@msn.comGage.Foster@msn.com
1401a0N6100000uMkXPEA00054o000004Y2Q1QAK00561000001gIDfAAMSouthwestPaul SorvinoPaul.Sorvino@msn.comBeth.Couch@msn.com
1402a0N6100000uMkXPEA000561000002KUYXAA400561000001gIDfAAMSouthwestEmma ThompsonEmma.Thompson@msn.comBeth.Couch@msn.com
6 REPLIES 6
lbendlin
Super User
Super User

Your RLS is ineffective as it can be overwritten by the Geo Map Translations filters.

 

Territory assignments should be fully spelled out in SFDC, and you should be able to base your RLS exclusively on the assignments object.

 

 

thanks Ibendin.....i can get ride of geo mapping table and solely use Territory table in SFDC ( i can incorporate all Geo map info into SFDC).....but in SFDC, each TM can only see their own territory and account.....i am not sure how to leverage it for my PBI dashboard which allow territory manager to view the whole region. 

 

i feel i still need a middle table to do it though

I have no right to criticize your SFDC setup but it sure sounds weird.

 

Yes, if you can combine the tables you will be better off.  This true in 99% of the cases where you have a bidirectional 1:1 relationship betweeen tables.

thanks Ibendlin. i am not SFDC admin in the company. so i have to use what they can provide.

 

so if i understand correctly....if region field lives in shipping detail table and Territory SFDC table, i can link the two tables by region.....it is gonna be many to many relationship.....will it work? 

 

i guess the logic is that if 1101 territory manager log into PBI, Territory table will point it to Appalachian region....which in turn filter the data in the shipping detail for Appalachian only, right?

 

thanks again

This will work even with M:M relationships BUT the search directiion must be one way from the RLS table to the fact table.

leilei787
Helper II
Helper II

@tamerj1 hi Tamerj1, do you know any solution on this issue? appreciate your help!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors