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

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.

Reply
ZoltanBojtar
Regular Visitor

FIRSTDATE and LASTDATE functions return first and last day of year, not column values

Hi, I have the below table with dates ranging from 2018.04.01 to 2019.04.01 with multiple payments in each month for multiple policies:

kép.png

 

I need a measure that returns the latest date in that column, so I used LASTDATE(Payments[PaymentDate].[Date]), but that returns 2019.12.31, not 2019.04.01. Why could this be? Thanks!

 

1 ACCEPTED SOLUTION

Except that 2019.12.31 is not among the existing values in that column, 2019.04.01 is the last. 😉

A friend of mine helped me out and  LASTDATE(Payments[PaymentDate]) without .date at the end gave me the expected result, thanks!

View solution in original post

3 REPLIES 3
shushivick7
New Member

I had same issue where the FIRSTDATE formula pulled the very first date of its year, rather than the first date within the record...

I fixed with using MIN/MAX instead + not using the .[date] like Zoltan. 

I have no idea why this fixes it but it is fixed...

Ashish_Mathur
Super User
Super User

Read your question once again.  2019.12.31 is definitely > 2019.04.01 so the measure is working fine.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Except that 2019.12.31 is not among the existing values in that column, 2019.04.01 is the last. 😉

A friend of mine helped me out and  LASTDATE(Payments[PaymentDate]) without .date at the end gave me the expected result, thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.