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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

cant lookup value from Var to table in model

I am trying to do a lookupvalue.

 

I have a variable where I have a Key,and I want to search that Key in the employee table.

 

 

...

var Final5 =
FILTER(
SUMMARIZE(Union5,'Staff'[Key_Employee],'Date'[Week],"summ", SUM(Staff[Hours])
),
[summ]>10
)


Var final = SUMMARIZE(union (final1,final2,final3,final4,final5), 'Staff'[Key_Employee])

 

 

Now, I want to return:

 

return ADDCOLUMNS(final,  LOOKUPVALUE(Employee[Name],Employee[Key_Employee], final[Key_Employee] 

(but this doesnt work...)

 

neither does

 

return ADDCOLUMNS(final,  LOOKUPVALUE(Employee[Name],Employee[Key_Employee], 'staff'[Key_Employee] 

 

How can I achieve it?

1 REPLY 1
smpa01
Super User
Super User

@Anonymous  try this

 

var Final5 =
FILTER(
SUMMARIZE(Union5,'Staff'[Key_Employee],'Date'[Week],"summ", SUM(Staff[Hours])
),
[summ]>10
)

Var final = SUMMARIZE(union (final1,final2,final3,final4,final5), 'Staff'[Key_Employee])
RETURN ADDCOLUMNS(final,"@Employee.key", MAXX(FILTER(Employee, Employee[Key_Employee]=earlier([Key_Employee)),Employee[Name]))
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.