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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
giorgiokatr
Helper V
Helper V

making rank work after applying rls security

my rank works great but if i use rls tofilter a branch for example make a role to use only branch 2

rank does not work

is there any workaround to make this work?

 

 

RankBranchall = RANKX(ALL(Branches);[% Diff.];;ASC;Dense)

 

 

1 ACCEPTED SOLUTION

Rank works across visible data.

 

So if there is the following

 

A 10

B 30

C  5

D  40

 

Rank will be 

D

B

A

C

 

If someone can only see A and B, rank will be

B

A

 

If you want to see the original rank you need to evaluate the ranks and store them in your data model so everyone can see them.  You can do this probably best in a summary table.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

5 REPLIES 5
MattAllington
Community Champion
Community Champion

What do you mean “it does not work?” Do you mean it only works over the sub set of the data visible to the RLS?  If so, I suggest you will need to write the data to a calc column or summary table. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

thanks @MattAllington

 

there are 400 branches so without rls rank goes from 1 to 400 (based for example in sales of each branch)

when i use rls branch 2 has only rank 1 beacause it is filtered

is it possible to only be able to see branch 2 (rls ) but calculate the right rank?

Rank works across visible data.

 

So if there is the following

 

A 10

B 30

C  5

D  40

 

Rank will be 

D

B

A

C

 

If someone can only see A and B, rank will be

B

A

 

If you want to see the original rank you need to evaluate the ranks and store them in your data model so everyone can see them.  You can do this probably best in a summary table.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

thanks @MattAllington

it is quite difficult to create summary tables as there are many dimensions in my rank report (time,hierarchy, many ranking kpis)

I was trying to find a way to bypass rls for calculating rank

RLS is designed to prevent the data being available to those that should not see it. No you can’t get around this.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors