Forum Discussion
Date column is not a date?
Hi,
I'm trying to create a calculated column which is based on whether a date field is less than another date value. However, my date field is not behaving like a date and I'm not sure how to troubleshoot anymore (I've been staring at it all day) :-(
My formula is as follows:
2 Replies
- TomMartensSuper User
Hey,
I do not fully understand what you want to achieve ...
But, you can't (at least not in most of the cases) use a measure within a calculated column.
This is basically due to the timing of evaluation. Basically calculated columns are getting evaluated just once, this is when the data will be refreshed. in contrast to this, a measure will be evaluated whenever the user interacts with the data, e.g. selceting an item from a slicer or he interacts in other ways with the data. This means the measure maxDate will be evaluated just once, when calculated column inside the table will be "refreshed", and besides that "Power BI Desktop" assumes that no interaction has been happened. This assumption results to "latest" date from your calendar table.
Hopefully, this provides a starting point for rethinking your solution. if maxdate is dependent on user interaction you also have to make "current employee" a measure and filter the data using measures.
Regards,
Tom
- MFelixSuper User
Hi Anonymous ,
Just looking at the table you are returning it appears to me that the create date column is not on the date format, can be wrong and just be a formatting of the date when compare to the MAXDATE measure.
Can you share a sample file?
Regards,
MFelix