Problem with logic while using filter/lookup formulas

Hi there, my question is probably a very simple one but after hours, trying to make it work, I decided to ask here. What I want to do is kind of simple but i suppose I am still stuck with old developper or excel thinking or something like that.

Here is what I want to do : I want to get corresponding price from a price table to an item table.

Thing is, I tried multiple variations and none worked :

[Domain price].TLD.Lookup(thisRow.[Corresponding TLD],[Domain price].TLD)

Lookup([Domain price],PRICE , thisRow.[Corresponding TLD])

[Domain price].PRICE.Filter(thisRow.[Corresponding TLD]=[Domain price].TLD)

If someone can point me out where my logic is wrong, I would highly appreciate it. I want this app to work but it’s a pain when I can’t do something this simple.
Thanks for your help,
Jm

[Domain price].Filter(thisRow.[Corresponding TLD]=[Domain price].TLD).Price :wink:

Or even better:
[Domain price].Filter(thisRow.[Corresponding TLD]=[Domain price].TLD).Price.First() to explicitly state that you only need a single value

You filter the table, THEN dereference value from the column, not the other way around.

Hi Paul, thank you for your quick answer!
Now I understand the concept of table.filter(test).column-to-return thank’s to you.
Unfortunately, I still can’t make it work. As you can see in this screenshot, just under the formula, it returns nothing :

Why is that happening? I checked column types, I do not see anything wrong.

Oh, sorry, was answering from mobile and missed one crucial thing.

Not Domain price.TLD but CurrentValue.TLD. You want to compare thisRow's TLD to each element of the Domain price table (hence CurrentValue), not to the whole column (which you’re doing when you specify it in TableName.ColumnName notation — notice the icon that hints it’s a collection of Text columns)

The correct formula would be:
[Domain price].Filter(CurrentValue.TLD = thisRow.[Corresponding TLD]).PRICE.First()

This works perfectly. Thank you. I will study this logic!
The concepts of CurrentValue and thisRow are still a little obscure to me.
I greatly appreciate your help.
Thanks a lot!

Dear @Jmboulay

The formula explained in steps, although it sounds weird:

Find table “DomainPrice”
Filter in “thisrow” the value in the column “TLD”
Find the corresponding value in “DomainPrice”
Show accordingly the “First” value from the column “Price” that is corresponding

All credits to @Paul_Danyliuk as he is one of the contributors that has supported to get also my head around :handshake:

Thank you so much, both of you!
I think I am getting more and more comfortable with those concepts.
I appreciate your help on the matter.