Forum Discussion
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_)
6 Replies
- lbendlinSuper User
Read about CROSSFILTER(,,NONE) - that allows you to temporarily break relationships.
- Sri_phaniHelper 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_)- lbendlinSuper User
use CALCULATETABLE instead of FILTER
- lbendlinSuper User
There is an alternative - use a shadow table that is disconnected from the data model.