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 |
---|---|
38 | |
35 | |
27 | |
23 | |
18 |