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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Select Rows From Another Tables With Unmatching Dates

Hello everyone, I had posted a message this morning and I thought I had found the solution but it seems that I still need help writing in PowerQuery. 

 

So, I remind my question, I had a table with my orders (named: OrdersSA18_PowerBI) and another with my exchange rates (named: Exchange Rate Table). 

 

Capture d’écran 2022-03-09 123055.png

Capture d’écran 2022-03-09 123317.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I would have liked to add my exchange rate to my orders table. The problem being that I don't have an exchange rate for each day in my exchange rate table. So I would like to have my exchange rate for each order date so that : [Currency Code] = [Currency Code] and [Order Date] <= [Starting Date]

 

Here is what I Had written in "Add a new column":

 

Capture d’écran 2022-03-09 124603.png

But it doesn't work and doesn't give me what I want despite the fact that the syntax is correct.

 

Thank you very much in advance, you are a great help for the community.

 

3 REPLIES 3
Anonymous
Not applicable

 

you should modify thie part of you script

from

[Currency Code] = [Currency Code] and [Order Date] <= [Starting Date]

 to

OrdersSA18_PowerBI[Currency Code] = [Currency Code] and OrdersSA18_PowerBI[Order Date] <= [Starting Date]


I couldn't test the expression obviously, but I hope it's enough to get you through the impasse

 

Anonymous
Not applicable

Unfortunately I have the message that no column was found when I apply your solution as you can see on these screenshots

Capture d’écran 2022-03-10 091204.pngCapture d’écran 2022-03-10 091230.png

Do you know how I can fix it? Thank you very much for your intervention.

Anonymous
Not applicable

If you want to have a quick and useful answer, try to upload a file with the starting tables and the desired arrival table.

 

 

I didn't realize it was inside anotherfunction  ( table.add.column)

try this inside the box of addcolumn (colonne personaliseé)

 

 

 Table.SelectRows(tablename, (r)=>r[Currency Code] = [Currency Code] and r[Order Date] <= [Starting Date])

 

 

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.