Forum Discussion
JC2022
Helper III
3 years agoExclude dates from another table
Hi, If I have the formula below but I would like to exclude the dates that are in my Holidays table (a different table). How do I do this? =
SUMX (
Schedule,
SUMX (
FILTER (
...
tamerj1
Community Champion
3 years agoHi JC2022
Please try
=
SUMX (
Schedule,
SUMX (
FILTER (
Hours,
Hours[Schedule ID] = Schedule[Schedule ID]
&& Hours[Date] >= Schedule[From Date]
&& Hours[Date] <= Schedule[To Date]
&& NOT ( Hours[Date] IN VALUES ( Holidays[Date] ) )
),
Hours[Hours]
)
)- JC20223 years ago
Helper III
Hi tamerj1
this is indeed excluding the dates, so it is not even showing the dates anymore. It's probably visually better to still show these dates but just return 0hours on these holiday dates.
What do you think? and how to do this?
- tamerj13 years ago
Community Champion
JC2022
Just add 0 like:= SUMX ( Schedule, SUMX ( FILTER ( Hours, Hours[Schedule ID] = Schedule[Schedule ID] && Hours[Date] >= Schedule[From Date] && Hours[Date] <= Schedule[To Date] && NOT ( Hours[Date] IN VALUES ( Holidays[Date] ) ) ), Hours[Hours] ) ) + 0- JC20223 years ago
Helper III
Perfect!
Many thanks!