Forum Discussion
Current week date filter applied to all days between two dates
- 2 years ago
Hi @SHenderosn
You should be able to achieve this by adding a calculated column in your PTO table that checks whether the specific record is in the current week or not. This column can then be used as a Slicer to filter whether a PTO falls within the Current Week.
Just update the below to your table and column names and it should work well. You can then add this as a slicer and achieve your desired output.
PTO_In_Current_Week = VAR _start = CALCULATE ( MIN ( 'DateTable'[Date] ) , 'DateTable'[CurrentWeekOffset] = 0 ) VAR _end = CALCULATE ( MAX ( 'DateTable'[Date] ) , 'DateTable'[CurrentWeekOffset] = 0 ) RETURN IF ( AND ( 'PTOTable'[Start Date] <= _end , 'PTOTable'[End Date] >= _start ) , "Current Week" , "Not Current Week" ) )Hope this works okay!
Theo
- Anonymous2 years ago
This is exactly what I needed, thank you!
Anonymous also, there is a really great post by v-jiascu-msft (Dale) that provides a very simple solution to achieve your desired output as well in the form of a calculated column. You can refer to it here:
https://community.fabric.microsoft.com/t5/Desktop/Determine-if-date-is-between-2-dates/m-p/314685
Again, you can use the calculated column as a Slicer to achieve the requirements you are after and adjust the output in Dale's solution.
Have a great day and all the best!
Theo 🙂