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
Powerbiji99
Frequent Visitor

Dax lookupvalue return top row

Please help with this Dax:

I have a purchase ref#=lookupvalue(‘table1’[ref#],
‘Table1[purchase amount],’table2[purchase amount]

Issue is table 1 has multiple line that repeat the purchase amount for a reference number. I want only the first row to be looked up and returned.

5 REPLIES 5
Anonymous
Not applicable

Hi @Powerbiji99 

 

Could you please share the dummy data set and expected output. 

 

Regards

Uphar

 

Happy To Help!

The goal is to link 2 datasets by a reference number. The  lookupvalue Dax is being used to match 4 variables and return reference number if match. Problem with the amount is that it's being double, triple counted depending on number of lines 

 

 

Powerbiji99
Frequent Visitor

The data set in table 1 is an extract. There are multiple lines with the same amount referencing the same ref#.  The multiple lines are due to coding distribution. 

table 2 on the other had only has one line referencing the ref#

Also, I can't use data model to link the ref# because there are 3 other variables in the lookupvalue 

AlB
Super User
Super User

Hi @Powerbiji99 

What determines the first row? What column? A date perhaps? Internally DAX knows no order in the rows so you need something to specify that order. With that you could extract the MIN of the results that have that purchase amount.

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

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