Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

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:  

 
Calculated column:  Current Employee = IF(Datevalue(Employees[createDate]) < [maxDate], true, false)
Measure:  maxDate = max('calendar'[Date])
 
The result is that 'Current Employee' is set to true for all records.
 
When I add a column to test the value of [maxDate] (subtract dates), I get weird results, which tells me [maxDate] is not actually a date value (at least I don't think it is).
powerbi.png
 
I've checked that maxDate is of type date, calendar[date] is of type date, createDate is of type date.  I do not have a relationship between Employees and calendar (and cannot put one on as it will not return the correct recordset).
Anyone have any ideas as to what else I can look into, as to why my date field is not behaving properly?
 
Thanks

 
 
2 REPLIES 2
MFelix
Super User
Super 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


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



TomMartens
Super User
Super 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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors