Forum Discussion
Matrix filter on weekly basis
Hi,
I have a timesheet report for our team members which is made of a matrix breaking down into weeks and then a list of team members and their hours worked in that week.
The problem is some of our team members will leave the workplace but our HR has already auto populated public holiday leave in their timesheet. So the matrix shows every employee each week, including those who have left the company.
I have made a column in my timesheet entry table called "WasCurrentTeamMemberInWeek" in which I check if the week is greater than employee's leave date. If I add this to my matrix the employee list will be broken down into two list, those who are in the company and those who have left.
Is there anyway to show only the current team members for each week, without having to add the additional measure to matrix? If I add the filter to visual or page level, it filters the False values on all weeks, including the weeks that a team member was actually still employed.
In other words I only want to see the team members who have worked and were still employed in any given week.
- Anonymous4 years ago
Hi hoss ,
I think you need to update the code of [WasCurrentTeamMemberInWeek] column as below.
WasCurrentTeamMemberInWeek = VAR _LOOKUPVALUE = LOOKUPVALUE ( EmployeeList[Last_Working_Day], EmployeeList[Employee], TimeSheets[Employee] ) RETURN IF ( ISBLANK ( _LOOKUPVALUE ), TRUE (), TimeSheets[Date] <= _LOOKUPVALUE )Then add this calculated column in visual level filter in matrix and set it to show items when value = "True".
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- amitchandakSuper User
hoss , You can WasCurrentTeamMemberInWeek as a visual to page-level filter.
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.- hossFrequent Visitor
Hi amitchandak I tried but applying that filter and choosing True values will filter the data for all weeks. Eg, if a team member has left the company on 20/03/2022, I will not see his timesheet in week ending 25/03/2022 (which is ok) but I also cannot see his timesheet in any dates before that (which is not ok).
- AnonymousNot applicable
Hi hoss ,
Could you share a sample file with us? And you can show us a screenshot with the result you want. I need to know more details about your table. This will make us easier to find the solution.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.