Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Row level security - Test VAR table with ISEMPTY error

Background: Row-level security is required such that a null entry will return ALL values and non-null entries will return the specified values.   Examples: 1. User1 logs in and RLS filters data so...
  • Anonymous's avatar
    Anonymous
    5 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
    )