Problem: DAX is not returning expected result in if statement with operator when date is a variable.
Background: I've checked to make sure that there is no date or time difference. Dates are ALL in format (1stday of month, 12:00:00AM). I have 2 years (2018 & 2019: 24 distinct dates). I've tried to use the <= operator in a calculated column to determine if a date is "Before/Same" to a variable date or "After". I've tried to combine < filter and = filter with || (or), same result.
TestColumn =
var CurrentDate = [Current_Period]
return
IF(
ValuesTable[Month-Year] <= CurrentDate,
"Before/Same", "After"
)
FYI: The [Current_Period] Measure, this works fine, returns one date as expected
Current_Period =
VAR ThisActMonth =
CALCULATE (
DISTINCT ( Fact_FX[Month-Year] ),
Fact_FX[bool_Latest_FX_Act] = TRUE ()
)
RETURN
ThisActMonth
I would expect that for every row where the Month-Year (Date) <= the result would be "Before/Same"; however, The result I currently get is:
"Before/Same" only where ValuesTable[Month-Year] = CurrentDate CurrentDate = April 2019
"After" all other Months (23)
Please Help!