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
Anonymous
Not applicable

Dynamic RLS from a SSAS Tabular Model Data Source

Hi All

 

I have spent may too much trying to figure this out and keep getting stumped and would appreciate any help I can get in getting the RLS working.

 

My user table, called Query look like the one below but with over 10000 rows.

 

Row NoPathdEmployeeIDEmployeeHRContactIDUPN2FullNamePthCntnsGUIDGUIDUPN
1124072|288975|160261|193612|251905251905193612sjasper001Nola ViauFALSEnviau001[email protected]
2124072|288975|160261|193612|251905|120345120345251905sjasper001Bernadine GulledgeFALSEbgulledge001[email protected]
3124072|288975|160261|193612|251905|120345|116884116884120345sjasper001Joey WarneFALSEjwarne001[email protected]
4124072|288975|160261|193612|251905|120345|127392127392120345sjasper001Keva DowFALSEkdow001[email protected]
5124072|288975|160261|193612|251905|120345|138799138799120345sjasper001Sophia CorsiFALSEscorsi001[email protected]
6124072|288975|160261|193612|251905|120345|13959081395908120345sjasper001Dalton McmillanFALSEdmcmillan001[email protected]
7124072|288975|160261|193612|251905|120345|22625222262522120345sjasper001Karmen SharerFALSEksharer001[email protected]
8124072|288975|160261|193612|251905|120345|24762272476227120345sjasper001Isidra WurstFALSEiwurst001[email protected]
9124072|288975|160261|193612|251905|120345|252840252840120345sjasper001Berniece FellersFALSEbfellers001[email protected]
10124072|288975|160261|193612|251905|120345|276943276943120345sjasper001Migdalia ElliottFALSEmelliott001[email protected]
11124072|288975|160261|193612|251905|120345|314882314882120345sjasper001Normand ZertucheFALSEnzertuche001[email protected]
12124072|288975|160261|193612|251905|120345|473396473396120345sjasper001Flossie BloydFALSEfbloyd001[email protected]
13124072|288975|160261|193612|251905|155682155682251905sjasper001Alita BlackwoodFALSEablackwoo001[email protected]
14124072|288975|160261|193612|251905|192923192923251905sjasper001Siobhan JasperTRUEsjasper001[email protected]
15124072|288975|160261|193612|251905|192923|118052118052192923sjasper001Dannielle HammanFALSEdhamman001[email protected]
16124072|288975|160261|193612|251905|192923|137052137052192923sjasper001Alona PlatterFALSEaplatter001[email protected]
17124072|288975|160261|193612|251905|192923|194383194383192923sjasper001Wallace BrazealFALSEwbrazeal001[email protected]
18124072|288975|160261|193612|251905|192923|201697201697192923sjasper001Garnet NilgesFALSEgnilges001[email protected]
19124072|288975|160261|193612|251905|192923|216452216452192923sjasper001Karrie SeylerFALSEkseyler001[email protected]
20124072|288975|160261|193612|251905|192923|221116221116192923sjasper001Sofia AndersenFALSEsandersen001[email protected]
21124072|288975|160261|193612|251905|192923|279296279296192923sjasper001Steven FeathersFALSEsfeathers001[email protected]
22124072|288975|160261|193612|251905|192923|38300323830032192923sjasper001Polly TeelFALSEpteel001[email protected]
23124072|288975|160261|193612|251905|254767254767251905sjasper001Tabitha MullinixFALSEtmullinix001[email protected]
24124072|288975|160261|193612|251905|936324936324251905sjasper001Janae PechacekFALSEjpechacek001[email protected]
25124072|288975|160261|193612|251905|936324|167089167089936324sjasper001Ariel TempelFALSEatempel001[email protected]
26124072|288975|160261|193612|251905|936324|210530210530936324sjasper001Yi MumfordFALSEymumford001[email protected]

 

The Pathd column is defined as PATH(Query[EmployeeID],Query[EmployeeHRContactID])

The UPN2 is an extract of the USERPRINCIPALNAME excluding the domain of the user access the model in the service

The GUIDUPN is a combination of the GUID and the domain.

The PthCntns is TRUE where the incoming USERPRINCIPALName equals the GUIDUPN.

 

What I need it to display is all the users who report to a user.  If the user is Siobhan Jasper (row 14), then I would need to see all the records where Siobhan's EmployeeID appears in the PathD (rows 14 to 22)

 

The rule on the Role in SSAS is defined as:

 

 

 

=if(
PATHCONTAINS(
'Query'[Pathd],
MAXX(
FILTER(
Query,'Query'[GUIDUPN]=USERPRINCIPALNAME()),
'Query'[EmployeeID])),
'Query'[Display]=1,
'Query'[Display]=0
)

 

 

 

My Gateway will parse the incoming USERPRINCIPALNAME as [email protected] if Siobhan Jasper is the user viewing the dashboard.

 

I hope I have explaned this well enough for everyone to understand and hopefully be able to assist me?

 

Kind Regards

 

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

http://aboutpowerbi.com/index.php/2020/01/04/hierarchical-dynamic-row-level-security-rls/

See if that helps.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for this, it works perfectly, as long as SSAS is not involved.  

 

Maybe I should of mentioned that I am running as a direct query model.

Hi @Anonymous ,

 

If I didnt misunderstand wrong,you wanna set a RLS with a SSAS model,Right?

 

Here is a limitation about RLS that is ,only Import and DirectQuery connections are supported. Live connections to Analysis Services are handled in the on-premises model.

 

Here the link for the reference.

https://docs.microsoft.com/en-us/power-bi/service-admin-rls

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

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

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.