Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I created a "MaximumValue" column on my first able which pulls the highest "Value" from the second table for a specific Product. However, i also want to add a column to my first table called "NameOfHighestValue" as a DAX function. I used the LookupValue function, but i keep getting an error and wont work. Any help is appreciated.
NameOfHighestValue= lookupvalue(secondtable[name], secondtable[value], max(secontable[value]))
Any guidance will be great. Thank you.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@miguelsus2000
Here is the formula to add as a column to firsttable to fetch the name:
NameOfHighestValue =
VAR T1 =
FILTER(
secondtable,
secondtable[Product] = firsttable[Product]
)
VAR __MaxValue = MAXX(secondtable[Value],T1)
VAR __Name =
MAXX(
secondtable[Name],
FILTER(
secondtable,
secondtable[Product] = firsttable[Product] && secondtable[Value] = __MaxValue
)
)
RETURN
__Name
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 40 | |
| 21 | |
| 18 |