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.
Need help with comparing dates. DATEDIFF doesn't work. How can I compare those 2 dates?
org_chart_employees[term_date] is part of the table and it's a date column.
My DAX is:
Solved! Go to Solution.
Hi, @marjoriefialek
It’s my pleasure to answer for you.
According to your description,I think you may have some confusion about measure and column.
The calculation of 'column' precedes 'measure'. Your column references a measure. At this time, the measure has no specific context, which is equivalent to calculating in all (table). The measure calculated is always the minimum value in the entire table. So >= is always true and always "yes".
The column can't be changed interactively with the slicer. You need to convert the column to measure.
Like this:
VARTermedFlag =
IF ( MAX ( org_chart_employees[term_date] ) >= [VARTermed], "yes", "no" )
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @marjoriefialek
It’s my pleasure to answer for you.
According to your description,I think you may have some confusion about measure and column.
The calculation of 'column' precedes 'measure'. Your column references a measure. At this time, the measure has no specific context, which is equivalent to calculating in all (table). The measure calculated is always the minimum value in the entire table. So >= is always true and always "yes".
The column can't be changed interactively with the slicer. You need to convert the column to measure.
Like this:
VARTermedFlag =
IF ( MAX ( org_chart_employees[term_date] ) >= [VARTermed], "yes", "no" )
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your answer. This will help me.
@marjoriefialek wrote:
they are all "Yes"
This is because columns are caculated and stored when the refresh operation is run. And at that time no selections are active so the ALLSELECTED() call in your measure returns all the rows. You cannot create a calculated column which changes dynamically in response to slicers or cross filters.
I'm not sure what you are trying to do here but you need to look at some way of incorporating your date check into a measure rather than using a column.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |