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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors