cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Mam1004 Frequent Visitor
Frequent Visitor

vlookup in power BI

Capture.PNG

Hello,

We have a requirement where we have to do a lookup .It was easy  to do in excel but I am unable to figure it out in power BI(we are doing a data connection to bring the data from excel  and these column are custom columns) .

 

We need to mark the column B as the value of column A,where A column data is based on some condition,

 

for ex:  if the Id  is 102  the do a vlookup on comboid and if it matches copy the value of A1 into B2

 

Any help will be much appreiciated.

Thank You,

Mam

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: vlookup in power BI

Hi @Mam1004 ,

 

You need to create a new calculated column “B”.

B =
CALCULATE (
    FIRSTNONBLANK ( 'Table'[A], 1 ),
    FILTER (
        'Table',
        'Table'[COMBOID] = EARLIER ( 'Table'[COMBOID] )
            && 'Table'[ID]
                = EARLIER ( 'Table'[ID] ) - 1
    )
)

Here is the result.1-1.PNG

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: vlookup in power BI

Hi @Mam1004 ,

 

You need to create a new calculated column “B”.

B =
CALCULATE (
    FIRSTNONBLANK ( 'Table'[A], 1 ),
    FILTER (
        'Table',
        'Table'[COMBOID] = EARLIER ( 'Table'[COMBOID] )
            && 'Table'[ID]
                = EARLIER ( 'Table'[ID] ) - 1
    )
)

Here is the result.1-1.PNG

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Super User
Super User

Re: vlookup in power BI

Hi,

Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Mam1004 Frequent Visitor
Frequent Visitor

Re: vlookup in power BI

Capture.PNG

 

Thanks for your prompt response.

 

I was really occupied with some GO -live activity so was not able to test the code.

I ahve a question, what exactly is the use of Table in the filter and what table name i have to use here.

I tried it and it is throwing thi s:Expression error: The name 'CALCULATE' wasn't recognized.I tried looking for this error but could not find much.

 

I tried putting CALCULATE in lower case also but still the error is popping up.

 

FYI:I am currently working on excel 2013 .

Mam1004 Frequent Visitor
Frequent Visitor

Re: vlookup in power BI

r your revert Aashish.I am new to this community ,i was unable to find an option to upload the excel sample file.

 

let me know how exactly i can provide u the info.

 

Thanks,

Mam

Community Support Team
Community Support Team

Re: vlookup in power BI

Hi @Mam1004 ,

 

"Table" is the table name where the data you use is located. And you need to use my codes in DAX instead of power query.Capture.PNG

About sharing files, you can upload to OneDrive and generate sharing links.

 

Best Regards,

Eads

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: vlookup in power BI

Hi,

Upload the file to OneDrive/Google Drive and share the download link here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 452 members 4,411 guests
Please welcome our newest community members: