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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Sri_phani
Helper III
Helper III

Ignore RLS and get the rank

Hi, 

I have Employee-wise RLS on the Active agent's table, but I have a separate table called All metrics that has KPIs (1-1 relationship). Now when I applied RLS the ranks show as 1. This is expected behaviour but while finding a workaround, I got to know by removing the relationship between these tables and using the TREATAS function we can get the rank. 

 

I tried many ways but couldn't find a solution. Here is the measure used for finding team-wise rank for selected employees: 

 

Team rank =
VAR table_ =
ADDCOLUMNS(
  FILTER(
    all('All Metrics'[Employee Name],
       'All Metrics'[Supervisor 1 (Team Manager) ]),
           'All Metrics'[Supervisor 1 (Team Manager)] = MAX('All Metrics'[Supervisor 1 (Team Manager) ])
           ),"attain", 
    [Resolve Attainment]
)
Return
Format(rankx(table_,[Resolve Attainment],,desc,Dense), 0)&"/"&COUNTROWS(table_)

 

 
Expected Result is like - 05/10
 
6 REPLIES 6
Sri_phani
Helper III
Helper III

@lbendlin Second table - ALL Metrics table is a disconnected table only on which Rank is created. 

Sri_phani
Helper III
Helper III

@lbendlin I tried using Calculatetable instead of filter, it is giving blanks as well in the result. Sorry, I am finding it hard to understand how can I put a stop to RLS while using Calculatetable function. 

 

Sri_phani_2-1724434340229.png

 

 

There is an alternative - use a shadow table that is disconnected from the data model.

Sri_phani
Helper III
Helper III

@lbendlin How do I incorporate Crossfilters in this measure? 

 

Team rank =
VAR table_ =
ADDCOLUMNS(
  FILTER(
    all('All Metrics'[Employee Name],
       'All Metrics'[Supervisor 1 (Team Manager) ]),
           'All Metrics'[Supervisor 1 (Team Manager)] = MAX('All Metrics'[Supervisor 1 (Team Manager) ])
           ),"attain", 
    [Resolve Attainment]
)
Return
Format(rankx(table_,[Resolve Attainment],,desc,Dense), 0)&"/"&COUNTROWS(table_)

 

use CALCULATETABLE instead of FILTER

lbendlin
Super User
Super User

Read about CROSSFILTER(,,NONE) - that allows you to temporarily break relationships.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.