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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
mterry
Helper V
Helper V

Merging with criteria

I have a table with financial information that has multiple dates in it, and another table with conversion rates by month that I would like to merge to the financial table. The problem is that I would like to use some conditions for merging: if there is a project end date in the finance table, then I'd like to use that month for the conversion, otherwise I'd like to use the most recent conversion rate available. What's the most efficient way to do that that will update with data refreshes? Thanks in advance. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mterry , In such case we create a calculated column

new column in table 1
=
var _date = maxx(filter(Table2, table2[Date] <= table1[Date]), Table2[Date])
return
maxx(filter(Table2, table2[Date] =_date), Table1[Exchange Rate])

 

we can add more condition like from currency , to currency

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mterry , In such case we create a calculated column

new column in table 1
=
var _date = maxx(filter(Table2, table2[Date] <= table1[Date]), Table2[Date])
return
maxx(filter(Table2, table2[Date] =_date), Table1[Exchange Rate])

 

we can add more condition like from currency , to currency

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Ok thanks for the reply, I'll try that. Would creating a calculated column make more sense than a DAX measure to achieve the same thing?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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