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

Lookup+pathitem not returning any results

Hello

I am trying to do bring some lookup value column into a table.


So my order column has more than one order ID in one row.

 

Product ID

2

3

2

3,4

 

I have to juxtapose this product description using lookupvalue

 

Product ID  Description (using lookup)

2                             Pen

3                              Pencil

4                            Eraser

2                            pen

3,4                         Pencil, Eraser

 

 

The lookup table has product id and descriptions. 

This is what I have done so far. I replace the delimeter from "," to "|" to leverage the PATH and related functions.

 

This is what I have done so far

 

Phase_Desc = var loopcount=PATHLENGTH(Subcontract[Phase Code(s)])
var n = GENERATESERIES(1,loopcount)
var companyname=" "
VAR __loopTable1 = ADDCOLUMNS(n,"company_name",companyname+LOOKUPVALUE(Phase[Phase Name],Phase[JHP_CODE],PATHITEM(Subcontract[Phase Code(s)],n,TEXT)))
RETURN
CONCATENATEX(__loopTable1,",")
 
I return a column with only "," correctly matching the pathlength which gives me the impression that the loop works but the lookupvalue is not being stored correctly.
 
I know the lookup works when I try it another column by providing hard coded indexvalue.
 
Can anyone help. Is there a better way to do this lookup
1 REPLY 1
v-yingjl
Community Support
Community Support

Hi @SV_community ,

Based on your description, your expected output seems clear but combined with your measure, I found that there seems two tables in the measure formula, what did the tables look like and the relationship between them, which table you want to add a new [Description] column?

Could you please consider sharing some sample data or a dummy sample file for further discussion?

 

Best Regards,

Yingjie Li

 

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