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
nagaraj007
Post Patron
Post Patron

Lookup value not showing correct data

Hello All,

 

I am trying to get the list name from other table called List, which contains word (ex Petrol ) and against that expense name (ex: Petrol = Vehicle Maintanance).

 

In my main table there is sentence which contains word called petrol, but its picking the wrong expense name.

 

Please advise.Lookupvalue.png

2 ACCEPTED SOLUTIONS

Hi, @nagaraj007 

 

Since there is more than one matching value in your data, you need to modify the code.

Like this:

Column = 
MAXX (
TOPN (
1,
FILTER (
ADDCOLUMNS (
tblLookUp,
"pos", SEARCH ( tblLookUp[List], PettyCash[Description], 1, 0 )
),
[pos] > 0
),
[pos], ASC
),
tblLookUp[Expenses]
)

vjaneygmsft_0-1627292205356.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,

Community Support Team _ Janey

View solution in original post

thank you very much @v-janeyg-msft  got the required output...

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

@nagaraj007 , I doubt the description might have a word conveyance in it.

 

You can also try

maxx(filter(tbllookup,search(tbllookup[list], prettycash[description],,0) >0),tbllookup[expense])

Hi Amit,

Attached image has the description wherein amont word comes first before petrol word, but however the lookup value is picking based on petrol not based on amont.

 

Please advisellokupvalue1.png

 

 

Formula used is

 

ExpCat =
LOOKUPVALUE(
tblLookUp[Expenses],
tblLookUp[List],
FIRSTNONBLANK(
FILTER(
VALUES(tblLookUp[List]),
SEARCH(tblLookUp[List],PettyCash[Description],1,0)
),
1)
)
 
 
 
Please advise, as we have to present the data..

Hi, @nagaraj007 

 

You need to modify your measure, but I need to know what your data is in powerbi.  Please upload some insensitive data samples and expected output. So we can help you soon.

vjaneygmsft_0-1627280967574.png

Best Regards,

Community Support Team _ Janey

Hi @v-janeyg-msft ,

 

Attached is the Download data .

Report has 2 tabs (One sheet is raw data) and sheet is List data.

Based on raw data description , it should pick the 1st word available from sheet 2 and show .

1st line item has 2 words (petrol and misc) but the output should be based on first word petrol ..

@nagaraj007   I need related tables(and not lists) data in powerbi desktop fields, 'tb1lookup' and 'pettycash'. 

 

Best Regards,

Community Support Team _ Janey

Hi @v-janeyg-msft ,

I have attached the PBIX file

Hi, @nagaraj007 

 

Since there is more than one matching value in your data, you need to modify the code.

Like this:

Column = 
MAXX (
TOPN (
1,
FILTER (
ADDCOLUMNS (
tblLookUp,
"pos", SEARCH ( tblLookUp[List], PettyCash[Description], 1, 0 )
),
[pos] > 0
),
[pos], ASC
),
tblLookUp[Expenses]
)

vjaneygmsft_0-1627292205356.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,

Community Support Team _ Janey

thank you very much @v-janeyg-msft  got the required output...

Hi @amitchandak ,

 

Could you please help me

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.