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 August 31st. Request your voucher.

Reply
PBI12345
Helper I
Helper I

Dax request: Filter a table's values based on values from another table

Hello,

 

In the below scenario, I have two tables. I am trying to build a measure that returns the value from Table2 associated with the maximum date from Table1 where column Time = "Past".

 

In this example, I would like my measure to return a value of "700".


I have tried a few different calculations but am struggling to filter one table's date range based on another. Would connecting the tables with an inactive relationship and using RELATED work? 

 

Any help greatly appreciated!

 

 

Table1 
DateTime
Jan-24Past
Feb-24Past
Mar-24Past
Apr-24Past
May-24Past
Jul-24Past
Aug-24Past
Sep-24Future
Oct-24Future
Nov-24Future
Dec-24Future

 

Table 2 
DateValue
Jan-24100
Feb-24200
Mar-24300
Apr-24400
May-24500
Jul-24600
Aug-24700
Sep-24800
Oct-24900
Nov-241000
Dec-241100



1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

HI, @PBI12345 

If you have relationship b/w both tables on Date Column then try below measure.

Measure =
var Max_date = calculate(max(table1[Date]),table1[time]="Past")
return
calculate(sum(table2[value]),Table2[date]=Max_date)



View solution in original post

1 REPLY 1
Dangar332
Super User
Super User

HI, @PBI12345 

If you have relationship b/w both tables on Date Column then try below measure.

Measure =
var Max_date = calculate(max(table1[Date]),table1[time]="Past")
return
calculate(sum(table2[value]),Table2[date]=Max_date)



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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