web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Get an if function to ...
Power Apps
Unanswered

Get an if function to step through a second table

(1) ShareShare
ReportReport
Posted on by 5

Hi all. I'm going a bit crazy with this so I'm really hoping someone can help. I have two tables and I'm trying to run an if statement that uses both.

 

I have a table of values in Table2 and the source data in Table1. I want the if statement to run through on every row of Table1 and check each row of Table2 to return a value if the conditions are met. The else is just to show any nonstandard cases.

 

I'm either missing something about using a list, or it can't be done. Below is what I have in the query but I just get an error stating that the >= can't be used with a list. I'm sure there's a simple answer, and that answer might be that it can't be done and I have to join the tables but I have to do this with a very long list and 5 different tables so I'm trying to avoid joining them.

 

Please help!?

 

 

#"new column" = Table.AddColumn(
#"previous step",
"New Column",
each
if (#"previous step"[Col1] >= Table2[Min] and #"previous step"[Col1] < Table2[Max])
then Table2[Value]
else 55
)

 

 

Categories:
I have the same question (0)
  • teylyn1 Profile Picture
    362 on at

    Hi,

     

    I think what you're after is an approximate match, but that is not easily done in Power Query.  Mynda Treacy has a blog post and a video on a similar scenario, using Excel tables as input for Power Query. Take a look at

    https://www.myonlinetraininghub.com/power-query-approximate-match-vlookup

     

    It is a series of steps that include a full outer merge and additional steps to fill in the blanks. 

  • nzfletch Profile Picture
    5 on at

    Thanks for the reply. That solution involves merging/joining the tables which is what I was trying to avoid. Looks like I might just have to do that though.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 893

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 482

Last 30 days Overall leaderboard