Here is a simple two column dataset which shows EmpID in column A and DateWorked in column B. My objective is to filter the table to show those employees who worked ONLY on August 17 and August 18. I’d like to exclude employees who:
- Did not work on both these days; and
- Worked on both these dates but also worked on other dates
A simple filter on the DatesWorked column with the criteria of August 17 and August 18, would return 7 employees. This is clearly wrong because this will show employees who:
- Worked on any of the two chosen dates; and
- Worked on dates other than the two chosen dates
From Table 1, one can clearly observe that the correct result should be EmpID E. Only EmpID E worked on August 17 and 18. While others also worked on both these dates, they worked on other dates as well and should therefore be excluded.
The problem outlined above holds true for selections made via a slicer in a Pivot Table as well. So this is a generic problem with a filter/slicer – conditions specified therein behave like OR conditions, not like AND conditions.
Filtered dataset (after specifying the criteria as 17 Aug and 18 Aug)
So the question is “How does one change the behavior of a filter/slicer from OR to AND?”. To make things worse, the data is arranged as follows:
As you can see, there are multiple dates in a single cell separated by a ;.
You may refer to my Power Query and PowerPivot solution here.