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

Looking Up Value from Another Table and Searching Column

Hello,

 

I'm trying get a column to search for a specific value in another table and if it finds that matching value, it will take the value in a specific column and apply it to the new column. I basically have a table with data that is mixed up together based on the 'Work Item Type' so I duplicated the table and filtered the other table to only show a specific 'Work Item Type'. The duplicated table is linked by a releated Work ID to the first table. I'm pulling data from VSTS if that helps.

8 REPLIES 8
v-jiascu-msft
Employee
Employee

Hi @SopandaT,

 

Could you please mark the proper answer as solution or share the solution if it's convenient for you? That will be a big help to the others.

 

Best Regards!
Dale

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

the problem I had with LOOKUPVALUE function is that I could not reference to a column in a table under search value.  I wanted to look up the same value in another table in one column and return the result of another column in that another table.  Not sure how I could do it. 

@jennympho- Can you explain that again with maybe an example?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

 

Hi Greg,

 

this is how I have resolved the problem at the end but i wonder if there's a quicker method.

 

I have 2 tables.

Table 1 - has 2 columns - account number and amount

Table 2 - has 2 columns - account number and whether overhead cost applies to that account number

 

I wanted to create a formula that will add the overhead cost to the amount if it should.

 

So, now this is how I have figured out to solve the issue:

1.  I added a calcuated column and use a LOOKUPVALUE function in table 1 to see if overhead cost should apply

2.  I added another calculated column to calcuate the overhead cost (amount x overhead rate) if overhead cost should apply

 

I wonder if this can be done in 1 formula and in 1 calculated column.

 

thanks for sharing your knowledge in advance!
Jenny

Greg_Deckler
Super User
Super User

LOOKUPVALUE is probably your best bet.

 

https://msdn.microsoft.com/en-us/library/gg492170.aspx


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I'm curently using LOOKUPVALUE and I get the error message "LookUpValue does not support comparing values of type integer with values of type text".Does that mean one of my columns that I picked is not the same as the other formats? I've tired using the expression FORMAT on that numeric column but I don't know what to put for the second condition if that makes sense. 

FORMAT(Value,Format) I don't know what to put in format.

You could use VALUE to convert from text to numeric, would have to see the data to see what is going wrong there.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

why dont you create a copy of that column with the same datatype create the relation and then hide it? 

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.