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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

help regards to Lookup

Hi,

 

I've a query regards to Lookup: Presented a Sample data as below:

 

1. 've 2 Tables1 & Table2

2. Table1 has details of the Emp and dept he worked based on month.

3. Table2  has Email ID and Month need to get the Dept names based on month. 

 

image.png

 

 

image.png

 

Please help with Dax

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula in Table2 works

=LOOKUPVALUE(Table1[Dept],Table1[Month],Table2[Month],Table1[Email ID],Table2[Email ID])

Hope this helps.

Untitled.png


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

View solution in original post

Hi @Anonymous ,

 

We can also create calculated colmun use following formula if there are multi matched Dept Values in Table1

 

Dept = 
VAR emp = [Emp]
VAR month = [Month]
VAR t =
    FILTER ( 'Table1', 'Table1'[Email Id] = emp && 'Table1'[Month] = month )
RETURN
    MAXX ( t, [Dept] )

 

2.PNG

 


BTW, pbix as attached.

 

Best regards,

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

Community Support Team _ Dong Li
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
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula in Table2 works

=LOOKUPVALUE(Table1[Dept],Table1[Month],Table2[Month],Table1[Email ID],Table2[Email ID])

Hope this helps.

Untitled.png


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

Try to create department as a column in table 2

dep id = Maxx(filter(table1,table1[month]='table2'[month] && table1[email id ]='table2'[emp]),table1[dept]) 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amith,

 

This doest nork for me, also the Syntax for Maxx is Maxx(Table,Expression). Could you pls attach a Sample and help me

Anonymous
Not applicable

Sorry, Dint work for me

This is in my file.

Max Sales order id = Maxx(filter(sales,Sales[item_id]='Item'[Item ID]),Sales[Order Id]) 

 

created a new one as Column not measure

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Could you pls attach .. I was creatig Column..

Hi @Anonymous ,

 

We can also create calculated colmun use following formula if there are multi matched Dept Values in Table1

 

Dept = 
VAR emp = [Emp]
VAR month = [Month]
VAR t =
    FILTER ( 'Table1', 'Table1'[Email Id] = emp && 'Table1'[Month] = month )
RETURN
    MAXX ( t, [Dept] )

 

2.PNG

 


BTW, pbix as attached.

 

Best regards,

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

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

Thanks it works for me

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.