How can I limit the display of some data based on the user’s role? I used an expression in which to filter based on a function, but I need it to be based on 3.
I used this expression: LOOKUP(USEREMAIL(), user, email, function) = “user role”
So I normally create a user table which stores the user name, login email address and role. Then in an app you can use something like to allow only admins & managers to do/see something
OR(
ANY(Select(Usertable[UserRole],[LoginEmail]=UserEmail()))=“Admin”,
ANY(Select(Usertable[UserRole],[LoginEmail]=UserEmail()))=“Manager”
)
me returns this error
Only one table scan instead of two:
ISNOTBLANK(
FILTER(
"UserTable",
AND(
(USEREMAIL() = [LoginEmail]),
IN([UserRole], {"Admin", "Manager"})
)
)
)
I adapted the expression and it worked. Thanks
adapted function:
or(
lookup(UserEmail(), user, email, function) = “Admin”,
lookup(UserEmail(), user, email, function) = “Manager” )
User | Count |
---|---|
16 | |
10 | |
9 | |
8 | |
3 |