cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Search with filter and tables relationship

Sorry guys, this question is surely answered tons of times, but I'm not getting through this.

I'm trying to combine filter and search:

 

Search(

    Filter(Orders_Articles; Order.ID = Selected.ID);

    SearchBox.Text;

    "cref0_article.ID"

)

 

I've understood that the problem is that I'm trying to navigate a 1 to many relation between Orders_Articles and Articles table, but how can I achieve that? Should I use a temp table or something? Many thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

Can you try to update your expression as:
 

Search(

    AddColumn(Filter(Orders_Articles; Order.ID = Selected.ID);"ArticleId",Text(cref0_article.ID));

    SearchBox.Text;

    "ArticleId"

)

 
This will create a column in the returned table based which holds the value of ID and you can use this to compare the result. If the ID is stored is not stored as Text, this expression will convert it into Text so that it will become a valid argument for Search function.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
yashag2255
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

Can you try to update your expression as:
 

Search(

    AddColumn(Filter(Orders_Articles; Order.ID = Selected.ID);"ArticleId",Text(cref0_article.ID));

    SearchBox.Text;

    "ArticleId"

)

 
This will create a column in the returned table based which holds the value of ID and you can use this to compare the result. If the ID is stored is not stored as Text, this expression will convert it into Text so that it will become a valid argument for Search function.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Anonymous
Not applicable

Many thanks! You'll hear me back soon again... 😃

 

Just a side note: the method is AddColumns with the final S even if you have just one field.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,322)