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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

How to refer to a date from another table?

Hello!

 

I a query, I want to filter rows using the MAX date from a column in a table of another query.

 

Any idea how to do that? I was thinking something like MAX(Table1.Column1) but I am not sure how it is exactly.

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

It's easy using DAX or Relationship. If you want to do this in Query Editor, you could refer to the following steps.

1# Sort the Date of Table2 from latest to earliest.

1.PNG

2# Add a custom column in Table1.

2.PNG

3# Add a conditional column and filter the null value.

3.PNG

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

It's easy using DAX or Relationship. If you want to do this in Query Editor, you could refer to the following steps.

1# Sort the Date of Table2 from latest to earliest.

1.PNG

2# Add a custom column in Table1.

2.PNG

3# Add a conditional column and filter the null value.

3.PNG

 

Best Regards,

Jay

TheoC
Super User
Super User

Hi @Anonymous 

 

I believe what you are looking for is LASTDATE?  Measure = LASTDATE ( 'table'[column]).

 

Hope this helps.

 

Also, if you don't already, I'd recommend adding a Calendar / Date table (https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/) which helps keep things nice and in order 🙂  You can then create relationships between the relevant Fact tables to the Date table and maintain filtering / slicing using the Dates from the Date table to ensure consistency and alignment.

 

Have a good one!

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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