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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ZakD
Frequent Visitor

Assistance Needed with Lookup Function Issue in Power BI

Dear Power BI Community,

 

I hope this message finds you well.

 

I am currently facing a challenge with a lookup function in my table view within Power BI. Although the function operates correctly for most records, it inexplicably fails for certain entries, including instances involving the same customer. I have attached a screenshot to provide a clearer illustration of the issue.

 

Could anyone provide insights or share if they have experienced similar issues? I appreciate any guidance you can offer.

 

Thank you for your support.

Best regards,


Zak.

ZakD_0-1722503200167.png

 



1 ACCEPTED SOLUTION
ZakD
Frequent Visitor

Among the solutions considered, I have selected the DAX function (MINX and FILTER). As a reminder, this is the  formula syntax:

---------------------------------------------------------------------------------------------------------------
ResultColumn = MINX(
FILTER(
Table2,
Table2[ID] = Table1[ID]
),
Table2[ValueToLookup]
)

 

Thanks again @HotChilli for your support, I could sort this thanks to your guidance.

View solution in original post

8 REPLIES 8
ZakD
Frequent Visitor

Among the solutions considered, I have selected the DAX function (MINX and FILTER). As a reminder, this is the  formula syntax:

---------------------------------------------------------------------------------------------------------------
ResultColumn = MINX(
FILTER(
Table2,
Table2[ID] = Table1[ID]
),
Table2[ValueToLookup]
)

 

Thanks again @HotChilli for your support, I could sort this thanks to your guidance.

ZakD
Frequent Visitor

The relations had already been disabled due to numerous circular relationships. Consequently, I utilized the lookup function to manage this complexity.

As you suggested, initially I attempted to merge the tables using an inner join, but encountered connectivity issues with my ODBC driver. Subsequently, I implemented an alternative approach using the MIN and FILTER functions, which proved to be highly effective. I plan to apply the same method to extract the remaining fields required.


Based on this experience, it seems that using MIN and FILTER functions might be a more suitable solution than relying on a lookup value for our current needs.

 

ZakD_0-1722595166423.png

 

Thanks for your help @HotChilli 

HotChilli
Super User
Super User

Ah, good, now we are into weird territory.

Do you have a relationship between the tables? Can you test by making the relationship inactive?

As a test, can you try and merge inner join on 1564 in Power Query to see if it works?

Can you write alternative dax to test without using lookupvalue (i.e. MIN with a FILTER)?

These are the sort of things I would look at.

---

I've read posts over the years of LOOKUPVALUE behaving like this and people have suggested a data refresh problem or a relationship interfering. I suppose it's possible.  Maybe we can solve it here for everyone.

ZakD
Frequent Visitor

I think I got what you meant so created a test column where I looked for the client_id 1564 and I had the same result, I filtered the data in my repair tab to show only client_id 1564

 

ZakD_0-1722517255653.png

 

ZakD
Frequent Visitor

Data type is number, for both columns in their recepective tabs.

 

What do you mean by hardcoding the lookupvalue?

HotChilli
Super User
Super User

Thanks, it's helpful. You will understand why I ask for proof.

What's the datatype on the client_id? Has the type been changed at any point?

--

Test this by hardcoding the LOOKUPVALUE to look for client_id 1564.  If it returns values correctly then the client_id is not really 1564 for the rows that are not working (it might look like it but something will be amiss)

ZakD
Frequent Visitor

Repair Tab:

ZakD_0-1722509223859.pngZakD_1-1722509259366.png

So this is the record as you can see it's the same client_ID, one record was correctly found and the two others were not

Customer Tab:

ZakD_2-1722509433341.png

This is the customer id from the customer tab

 

There is nothing to prove, I mean, as you can see, it worked perfectly fine for one of the 3 records but not for the others.
I do have other examples as well in case you still need any proof 🙂

HotChilli
Super User
Super User

Please show the ID and client_id fields of records which you expect to work but are not working (and the datatype of these fields)

--

In general, LOOKUPVALUE returns blank if there isn't a match so prove to me that you have a match.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.