Forum Discussion
filtering by the user without model RLS?
- 4 years ago
Yeah I agree, you could also use a COUNTROWS() on your Sales table and include a filter on every visual to only show results where the row count > 0, this would effectively hide any inapplicable dimensions.
The other option if you're looking for RLS to show all results to certain people (e.g. senior leaders) is to create a role in RLS (e.g Sales Director) where the condition is always true (i.e. 1=1), anyone assigned to this role will see everything
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hi fsim ,
You could use USERPRINCIPALNAME() in your measures, I'm not sure how advisable or secure this is since RLS was designed for exactly this purpose.
MySales = CALCULATE(SUM(Opportunities[SalePrice]),Opportunities[Owner] = USERPRINCIPALNAME())
You'd also have to apply this logic to every relevant measure, not sure how feasible that is, although Calculation Groups could help make that easier.
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Hello Mattww,
thanks for the answer.
this could indeed resolve the measure parts but not the list and the row filtering.
thanks anyway !
- mattww4 years agoResponsive Resident
Yeah I agree, you could also use a COUNTROWS() on your Sales table and include a filter on every visual to only show results where the row count > 0, this would effectively hide any inapplicable dimensions.
The other option if you're looking for RLS to show all results to certain people (e.g. senior leaders) is to create a role in RLS (e.g Sales Director) where the condition is always true (i.e. 1=1), anyone assigned to this role will see everything
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.