Forum Discussion
Row level security - Test VAR table with ISEMPTY error
- Anonymous5 years ago
Thanks for the input. I ended up creating a similar work-around though not using roles. It appears to me that currently DAX is unable to utilize logical operators on VAR tables or NULL returns.
So instead of using the original solution (original post), I modified the 'Area' dimension table to have an [All Selected] column with a specific value assigned to indicate all selected. I then used an || operator to concatenate values that check each column.This way, if user has the specific all value it will return all keys whereas if a user has any other value it will return only those.
RETURN
CALCULATETABLE (
VALUES ( 'Area'[Manager Key] ),
'Area'[Manager Key] IN vSMA
|| 'Area'[Manager All] IN vSMA
)
I have a similar business need where some users have to have restricted access while others should have unrestricted one. I handle this by creating 2 Roles, Restricted with the same role you designed. and Unrestricted without any filtration.
Just assign restricted users to the Restricted role in your dataset while all others assign them to Unrestricted.
Thanks for the input. I ended up creating a similar work-around though not using roles. It appears to me that currently DAX is unable to utilize logical operators on VAR tables or NULL returns.
So instead of using the original solution (original post), I modified the 'Area' dimension table to have an [All Selected] column with a specific value assigned to indicate all selected. I then used an || operator to concatenate values that check each column.
This way, if user has the specific all value it will return all keys whereas if a user has any other value it will return only those.
RETURN
CALCULATETABLE (
VALUES ( 'Area'[Manager Key] ),
'Area'[Manager Key] IN vSMA
|| 'Area'[Manager All] IN vSMA
)