Lookup a column based on a partial match search

Hi Folks,  

I have a table that contains packages and its recevier (Firstame+Lastname single column) and I also have a table for Firstname + Gender. I would like to pull in a calculated column for Gender into the packages table . 

Is there a DAX approach , I can take?  Or I should split the First name, last name to do exact match  ?

tx,

Gabor

September 3rd, 2015 4:21am

Hi Gabor,

According to your description, you need to display Gender column on another table in your PowerPivot data model, right?

In your scenario, FirstNme and LastName on the same column, so we need to get the first name, and then using LookUpValue function to get the Gender column. I have tested it on my local environment, the sample DAX expression below is for you reference.
FirstName:=LEFT(test0904[Name],SEARCH(" ",test0904[Name])-1)
Gender:=LOOKUPVALUE(test09042[Gender],test09042[FirstName],test0904[FirstName])

Reference
http://parasdoshi.com/2013/11/13/example-of-an-dax-substring-equivalent/
https://msdn.microsoft.com/en-us/library/gg492170.aspx

Regards,

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 2:17am

hi Charlie,  

i am looking for a like operator for lazyness,as the names i have are non standard format it may also have a mid name in them. worst case i can parse them with c# but like i said ;) i am pretty lazy.

ta,

gabor

September 4th, 2015 4:06pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics