Forum Discussion
IF excel has vlookup code , it will get error when import in Power BI
Although the DAX functions are similar to those of Excel, there is no VLOOKUP in Power BI. Look into using LOOKUPVALUE. If the tables have a direct relationship and you are trying to create a calculated column from the many side of o a one-to-many relationship, you can use RELATED function. Note: LOOKUPVALUE expects a single result - unlike in Excel, it won't pickup the first match - it will throw an error.
oK,it may difficult for me to understand , let me do example :
1. i have import sheet A , with column A ; sheet B with column A and B in power BI ;
2, Now i want create column B in sheet A based on colunmn A , that means A1 value in sheet A , then system look for A1 value in sheet B , find the related B value , then return to B1 in sheet A . so how to modify qury .
- ryan_mayu2 years ago
Super User
Anonymous
you can try to use IFERROR to remove errors in excel , then import to powerbi
or
you can do the vlookup in powerbi
https://learn.microsoft.com/zh-cn/dax/lookupvalue-function-dax?wt.mc_id=DP-MVP-5004616
- danextian2 years ago
Super User
you can use LOOKUPVALUE for that. But as previously mentioned, it doesn't work the way VLOOKUP in Excel does. For example, if your lookupvalue is A and there are two matching rows with different values in the other table, it will throw an error. As to the handling of errors like #N/A from Excel, please refer to my previous comments.