Forum Discussion
If Statement for Dates Between
I think you want something like this as a calculated column on Table 2:
Event_Day =
VAR CurrDate = Table2[Cal_Dt]
VAR EventCount =
COUNTROWS (
FILTER ( Table1, CurrDate >= Table1[Bg_Dt] && CurrDate <= Table1[End_Dt] )
)
RETURN
IF ( EventCount > 0, "Event ", "No Event" )
- Anonymous5 years agoNot applicable
This gets me much closer, but instead of returning "Event" for the Days between [Bg_dt] and [End_Dt] it is returning "Event" between the Max and Min of Table1. Table1 has several rows of Events with various begining and end dates in an unrelated table. When I choose an event in a slicer I need to evaluate the calendar table with those begining and ending dates. However, the context of the slicer is not carrying over to the calcualted column.
- AlexisOlson5 years ago
Super User
It is not possible for a slicer to affect a calculated column, so you'd need to use a measure instead.
However, it's not clear to me how exactly you'd be using such a measure, so I'd need more context to understand know how to write it.
- Anonymous5 years agoNot applicable
Since adding dynamic vertial lines is, for whatever reason, incrediablly difficult; I was hoping I could create a column that dynamically calculated against my calendar if a particual day was an event day or not. In this way I could use that column as a legend and highlihgt that portion of my line visual as an event. So, maybe there is another way to go about this?