cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
helohandrade
Regular Visitor

Hlookup with calculated columns

Hello all.

 

I'm trying to make a hlookup with calculated columns in PowerBI, but I still can not figure out how.

 

All columns in the table are calculated except "UF Descrição". The "maior envio" column returns me the maximum number of submissions for each state. In the case of Acre, the result is "Cont Jad" with 26 submissions. I need to create a column that the result of "maior envio" is "Cont Jad" in Acre.

 

 

POWERBI PROCH.PNG 

 

 In Excel the formula used is "= hlookup (X59; F59: W60; 2; 2)" where X59 = 26 ("maior envio").

 

proch novamente.PNG

 

 

 

Can you help me with this? I already got the value "26". Now I need "Cont Jad".

 

Right away, thank you.

7 REPLIES 7
v-yuezhe-msft
Microsoft
Microsoft

@helohandrade,

Could you please post sample data of tables which you imported into Power BI Desktop so that we can test? You can share the source Excel file through OneDrive.

Regards,
Lydia

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

Hello!

 

@v-yuezhe-msft sure!

 

PBI imported spreadsheet sample: https://www.4shared.com/s/fh9pCTKN_ee

 

another print of the table that I did in excel: 

 
powerbi32.PNG

 

And there is a print of the sample of table that I imported in Power BI:

 

powerbi22.PNG

 

 

Thanks again!

@helohandrade,

Please share the Excel files via Dropbox or OneDrive. I am unable to download the file from the above link.

Regards,
Lydia

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

Hi!

 

https://1drv.ms/x/s!AnxwHgdgp_LsghXnQxsDchfXtS1h

 

Here is the sample of the database used in Power BI.

 

Best Regards!

 

@helohandrade,

I am unable to find the calculated columns you mentioned in the sample Excel file. How do you create these calculated columns in Power BI Desktop?

Regards,
Lydia

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

Hi.

All the Cont's I made with countrows like

"Cont Jamef = COUNTROWS(FILTER(Compilados;Compilados[Transportadora] = "jamef")))

 

And maior envio I made with several max

maior envio = MAX(Compilados[Cont Diálogo];MAX(Compilados[Cont Jad];MAX(Compilados[Cont Jamef];MAX(Compilados[Cont LBR];MAX(Compilados[Cont Nowlog];MAX(Compilados[Cont Plimor];MAX(Compilados[Cont TNT];MAX(Compilados[Cont TNT];MAX(Compilados[Cont Total Express];(Compilados[Cont Transfolha]))))))))))

 

When I pull the value of "Transportadora" to the table, "maior envio" loses meaning, because the table lists all shipments of all carriers.
I just want the name of the carrier that has the largest number of shipments in the period for the state in the first column, in the way that "UF Descrição" do not become duplicate.

transp.PNG

So it has to appear:

 

Acre 26 Jadlog

Alagoas 79 Jadlog

Amapa 12 Jadlog

Amazonas 81 Jadlog

Bahia 423 TNT

 

etc.

 

Thanks

@helohandrade,

I am unable to reproduce the above DAX in the table you share to me, as I can't found all the columns you use in maior envio in the shared table.

Regards,
Lydia

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

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

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

Top Solution Authors