Forum Discussion
Filter table based on current user details
- Anonymous2 years ago
Hi Sumanth327 ,
Sorry for being late! Back to work.
Assuming you already have a measure dedicated to getting Dept Code, we can change DAX to:Measure = VAR _Current_User_Lab = [Current User Lab] VAR _Current_Dept_Code = [Dept Code] RETURN IF( _Current_Dept_Code <> 2132, IF( MAX('Table'[TrimmedDeptCreatedBy]) = _Current_User_Lab || MAX('Table'[TrimmedDeptProjLeader]) = _Current_User_Lab || MAX('Table'[TrimmedDeptTestResponsible]) = _Current_User_Lab, 1, 0 ), 1 )Here I am defaulting to 2132 as a numeric type, if you are using a text type, please change it to “2132”.
The final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Sumanth327 ,
You mentioned that you've managed to get Current User Lab via measure, so I'll use Slicer instead in my tests next. Here is my sample data:
Use this DAX to create a measure:
Measure =
VAR _Current_User_Lab = [Current User Lab]
RETURN
IF(
MAX('Table'[TrimmedDeptCreatedBy]) = _Current_User_Lab || MAX('Table'[TrimmedDeptProjLeader]) = _Current_User_Lab || MAX('Table'[TrimmedDeptTestResponsible]) = _Current_User_Lab,
1,
0
)
Set up the filter as shown below:
Drag the measure to the position indicated by the arrow:
Set the measure = 1 and Apply filter:
The final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.