Forum Discussion
Guidance on structuring data queries in a workbook for the purpose of lookup
Hi all.
Fairly new to Power Query & BI and used to excel and the functions used there.
I'm hoping someone can guide me on the correct way of structuring queries within power query for the following scenario.
I have data with muliple column info in one query (main query). Then I have 4 or more lists with unique values (a code) that is found in the main query as a column. The purpose of these lists are to lookup/evaluate whether a code value in the main list is found in the specific list and return either "YES" (if found) or "NO (not found). I see one way is to merge queries and then use an "if" function within an added column. That is one "lookup" to one unique valued list done. The main query is quite large and I don't want to re-create this step for each list to lookup/evaluate. Can there be mulitple query merges done in one step? How would one go about to set this up to Refresh optimally without having to run multiple duplicated huge data files for each lookup/merge?
I've created relationships as well between the queries and my logic tells me there must be a way that you can add new columns to the main query and do the evaluation in there referencing to the specific unique lists (for each column added), but I'm not sure how the syntax /whether DAX formula would look like and can't seem to find anything related.
Was also thinking that in each lookup/merged query to remove the unneeded columns and in some way add/reference them to the main query?
Any advise and assistance/guidance will be hugely appreciated.
- Anonymous4 years ago
Hi JacquesNolte ,
See the video: Power Query Approximate Match VLOOKUP - YouTube.
There's no equivalent function to perform an approximate match in Power Query like we can in Excel with VLOOKUP, but there is a super easy workaround in this video.
And you can match value in Power BI Desktop using DAX. Please refer to DAX - “CONTAINSX” – Finding if a value in table 1 has a matching value in table 2 - P3 Adaptive.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi JacquesNolte ,
See the video: Power Query Approximate Match VLOOKUP - YouTube.
There's no equivalent function to perform an approximate match in Power Query like we can in Excel with VLOOKUP, but there is a super easy workaround in this video.
And you can match value in Power BI Desktop using DAX. Please refer to DAX - “CONTAINSX” – Finding if a value in table 1 has a matching value in table 2 - P3 Adaptive.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.