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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors