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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.