Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Excel vlookup formula to Powerbi

Hi,
I need to convert the Excel vlookup to Dax - VLOOKUP(@BO:BO,'Transit Time query'!A:D,4,FALSE)

i have joined Route column in  BO Sheet with Transit Time query sheet -Route column and now i am not able to figure out - 'Transit Time query'!A:D,4,FALSE) how do i convert this to Dax column ? fianl output as Transit time (3,4, 10,60,80... ) 
pls check the screenshots attached below

Final Output - 

LikhithaVG123_2-1663766264238.png

 


BO Column Name - Route

LikhithaVG123_1-1663765955911.png

 



Transit Time Query Sheet - 

LikhithaVG123_0-1663765884848.png

 

1 ACCEPTED SOLUTION

Hi , @Anonymous 

This error occurs because that there are repeate data in 'Transit Time Query'[TransitTime],like this:

vyueyunzhmsft_0-1663826538623.png

 

You can try to user this dax to fix it:

Transit Time = CALCULATE(FIRSTNONBLANK('Transit Time Query'[TransitTime],TRUE()), FILTER('Transit Time Query','Transit Time Query'[Route]='BO Column Name'[Route] ) )

 

Best Regards,

Aniya Zhang

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

8 REPLIES 8
v-yueyunzh-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, you want to VLOOKUP [TransitTime] in 'Transit Time Query' table to the [Transit Time] in 'BO Column Name' table. Right?

You can click "New Column" in  'BO Column Name' table to create a calculated column:

Transit Time=LOOKUPVALUE('Transit Time Query'[TransitTime],'Transit Time Query'[Route],'BO Column Name'[Route])

You can refer to this document:

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Aniya Zhang

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

AnthonyJoseph
Resolver III
Resolver III

Hi @Anonymous 

can you use the below:

calculated column = Lookupvalue(Transit Time Query Sheet[Transit time],Transit Time Query Sheet[Route],Transit Time Query Sheet[Route])

 

There are many articles about Lookupvalue, you can give a read:

https://www.sqlbi.com/articles/introducing-lookupvalue/

 

AnthonyJoseph_0-1663787556847.png

Hope this helps

 

Thanks,

AnthonyJoseph

Anonymous
Not applicable

Hi AnthonyJoseph,
i am getting this error in calculated column, Pleae see the screenshot attached

LikhithaVG123_0-1663824532871.png

 

Hi, @Anonymous 

The third parameter is wrong, you can try to replace it to the  'BO Column Name'[Route].

 

Best Regards,

Aniya Zhang

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

Anonymous
Not applicable

Hi,
included 3rd parameter but still getting error as below

LikhithaVG123_0-1663825322712.png

 

Hi , @Anonymous 

This error occurs because that there are repeate data in 'Transit Time Query'[TransitTime],like this:

vyueyunzhmsft_0-1663826538623.png

 

You can try to user this dax to fix it:

Transit Time = CALCULATE(FIRSTNONBLANK('Transit Time Query'[TransitTime],TRUE()), FILTER('Transit Time Query','Transit Time Query'[Route]='BO Column Name'[Route] ) )

 

Best Regards,

Aniya Zhang

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

 

Greg_Deckler
Super User
Super User

@Anonymous There is a LOOKUPVALUE function in DAX although I find that MAXX(FILTER(...),...) tends to be more reliable.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Can you please provide the full syntax for this Vlookup ?
That will be more helpful

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors