Forum Discussion
Anonymous
5 years agoNot applicable
CalculateTable with If condition
Hi, I am working on Dynamic row level security. The requirement is, if the Username() is present in Emp_ad then evaluate table 1 expression else evaluate table 2 expression. 1st expression i...
Anonymous
4 years agoNot applicable
Even I got stuck at this step however found the solution while trying. Please use if you are still looking for this solution
you can create a third variable and provide OR condition in filter and call this variable in return
I started with creating a table. You can replace var vtable1 and vtable2 with yours
Table =
var vtable1 =
SELECTCOLUMNS(FILTER(Sheet1,LOOKUPVALUE('RLS Sample Data'[User_Account_Name],'RLS Sample Data'[Role_Code],"Admin",'RLS Sample Data'[User_Account_Name],"person email id")="person email id"),"__Email",Sheet1[Email])
var vtable2 =
SELECTCOLUMNS(FILTER(Sheet1,[Email] = "person email id"
|| [L5] = "person email id"
|| [L4] = "person email id"
|| [L3] = "person email id"
|| [L2] = "person email id"
|| [L1] = "person email id"
),"__Email",CALCULATE(VALUES(Sheet1[Email]),Sheet1[Email]<>"persona email id"))
This is the variable you have to create which will select either from vtable1 or vtable2
var vtable3 =
SELECTCOLUMNS(FILTER(Sheet1,Sheet1[Email] in vtable1 || Sheet1[Email] in vtable2),"Email",Sheet1[Email])
return
SELECTCOLUMNS(FILTER(Sheet1,Sheet1[Email] in vtable3),"Email",Sheet1[Email])
- Anonymous4 years agoNot applicable
Please mark as solution if this helps you 😊