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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
quantfinRguy
Frequent Visitor

LASTDATE issues

I have a date table ('Date Table'[Date]) connected to a date column of irregular start dates ('Table'[Date]).

 

For example, the irregular start dates could be:

1/31/2017

4/30/2017

8/31/2017

 

If I make an active relationship between 'Date Table'[Date] and 'Table'[Date], I run into this issue:

 

I am using a date slicer on 'Date Table[Date]' to select an "as of" date to run the report for. I want LASTDATE('Date Table'[Date]) to return the last date selected on the slicer. However, because of the relationship with 'Table,' it will instead only return one of the values 1/31/2017, 4/30/2017, or 8/31/2017.

The goal of the LASTDATE function is to implement the test: "is the selected date on the slicer on or after the start date for this column? Return TRUE or FALSE"

 

How do I get around this but keep the relationship active?

4 REPLIES 4
mattbrice
Solution Sage
Solution Sage

What's the full measure you are using? 

 

And keep in mind that LASTDATE is a table function which will transition a row context to a filter context....so having said that, you may want to use MAX ( 'Date Table'[Date] ) instead.

For all intents and purposes, the full measure is just LASTDATE('Date Table'[Date]), which in this case returns the same thing as MAX()

 

If I have my date slicer set for all dates on or before 9/30/2017, you would expect LASTDATE() to return 9/30/2017 on the date table.

However, in this case, it returns 8/31/2017 because it is last date that appears. 

 

I should note that I am using a calculated column rather than a measure. 

 

Calculated column for what part?  You are keeping in mind that Calculated columns are computed during data refresh, and not at run time.   A slicer based on a calculated column is fine; but a slicer won't trigger a re-calculation of a calculated column. 

can you share your measures/calc column and sample data, and also relationship model. it will help to debug



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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!

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.