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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
jonoren
Frequent Visitor

Get value from table by another rows value and the column name

So, my problem is as follows:

Firstly, I have the following table for currency exchange rates (for all currencies):

jonoren_0-1659905894328.png

 

and second, I have a table of reservations, each reservation has a currency code and a date. I want to add the specific currency exchange rate for each reservation, but cant seem to understand how to do so.

 

Thank you!

 

1 ACCEPTED SOLUTION

Hi @jonoren ,

 

Step 1:

Unpivot columns

KT_Bsmart2gethe_1-1659910270873.png

 

KT_Bsmart2gethe_0-1659910093630.png

KT_Bsmart2gethe_2-1659910294918.png

 Step2:

Merge

KT_Bsmart2gethe_3-1659910399128.pngKT_Bsmart2gethe_4-1659910474441.pngKT_Bsmart2gethe_5-1659910513859.png

 

Outcome:

KT_Bsmart2gethe_6-1659910549329.png

 

I hope it helps.

 

Regards

KT

 

 

 

View solution in original post

4 REPLIES 4
jonoren
Frequent Visitor

Perfect thank you!

KT_Bsmart2gethe
Impactful Individual
Impactful Individual

Hi @jonoren ,

 

If I understood correctly, you want to get the value from the reservations table to the currency rates table.

There are a few ways to achieve it; however, without knowing what your reservations table's format is, I can only provide a brief direction:

 

1. Unpivot the currency rates table to have all the code unpivoted, so you have a date and the code columns as key identifiers to apply the merge function.

 

2. Add custom column and apply the Table.SelectRows(ReservationsTbl, (lookup)=> lookup[Date]=[Date Column from the reservation table] and lookup[Code]=[Code column from the reservation table])[return column name]{row number}

 

Regards

KT

I actually want the other way around, the reservations table has hundreds of columns so I prefer not to share a screenshot, but you can think of it as a table that looks like this:

jonoren_0-1659908228715.png

 

and I want it to be this (using the exchange rates table)

jonoren_1-1659908259187.png

 

Thanks a lot!

Hi @jonoren ,

 

Step 1:

Unpivot columns

KT_Bsmart2gethe_1-1659910270873.png

 

KT_Bsmart2gethe_0-1659910093630.png

KT_Bsmart2gethe_2-1659910294918.png

 Step2:

Merge

KT_Bsmart2gethe_3-1659910399128.pngKT_Bsmart2gethe_4-1659910474441.pngKT_Bsmart2gethe_5-1659910513859.png

 

Outcome:

KT_Bsmart2gethe_6-1659910549329.png

 

I hope it helps.

 

Regards

KT

 

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Kudoed Authors