Forum Discussion

RichardTam's avatar
RichardTam
Helper I
3 years ago
Solved

Measure - Filtered table

 

Measure.sickLeave = 
var
_lookupaccessLevel=LOOKUPVALUE(accessLevel[Dept],accessLevel[username],USERPRINCIPALNAME())

return

calculate(sum(Sick_Leave[Sick Leave]),Sick_Leave[Dept]=_lookupaccessLevel)

 

I have this measure to calculate the sum of sick days. accessLevel is granted to manager (email accounts) so that they can only view information about their department.

 

This works fine until I wanted to show more than one variable. ie, if I include sick leave balance, data from other staff will be shown here.

 

My question is how can I modify the formula so it filter and returns the names of all the employees, so the filtering can be done for all values.

 

Measure.sickLeave =
var
_lookupaccessLevel=LOOKUPVALUE(accessLevel[Dept],accessLevel[username],USERPRINCIPALNAME())

return

calculate(sum(Sick_Leave[Sick Leave]),Sick_Leave[Dept]=_lookupaccessLevel)

1 Reply