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
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
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.