Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
So I'm very confused and I've probably missed something obvious but I have these two dates. The one on the left is a selected date in a slicer and the one on the right is the date from a row of data I'm trying to compare:
And this measure: (Above date on left is End_of_Month and date on right is [Contractual Leave Date])
The statement returns true for the above and switching to a less than sign returns false. Essentially the opposite of what my data would suggest. Any ideas why this is happening?
Edit 1: To add, I've noticed the measure DOES work for dates larger than the selected date, it just also returns true for dates below the selected date. Anything blank it returns as FALSE, so something seems to be wrong with the dates. The format of each is the same and I have other measures using the exact same two dates that work perfectly fine.
Solved! Go to Solution.
To align the formula with the conditions in your screenshot, you would need to wrap the Contractual Leave Date in a MIN() function. When you add a date column containing mul;tiple date values to a card visual, by default it will return the "Earliest" dates (which is equivalent to the minimum date in the column.
So to align your measure with the conditions in the two cards the DAX would be:
VAR End_of_Month = EOMONTH( SELECTEDVALUE('Date Table for Measures'[Date]),0 )
RETURN
IF(
MIN('HR Turnover Data'[Contractual Leave Date]) > End_of_Month,
"True",
"False"
)
To align the formula with the conditions in your screenshot, you would need to wrap the Contractual Leave Date in a MIN() function. When you add a date column containing mul;tiple date values to a card visual, by default it will return the "Earliest" dates (which is equivalent to the minimum date in the column.
So to align your measure with the conditions in the two cards the DAX would be:
VAR End_of_Month = EOMONTH( SELECTEDVALUE('Date Table for Measures'[Date]),0 )
RETURN
IF(
MIN('HR Turnover Data'[Contractual Leave Date]) > End_of_Month,
"True",
"False"
)
@Bananathan
is [Contractual Leave Date] a measure or a column? In the screenshot it says "Earliest" which has to be considered in the calculation. Please provide more context.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
46 | |
39 | |
19 | |
19 |