locked
Lookup a column based on a partial match search RRS feed

  • Question

  • 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

    Thursday, September 3, 2015 8:19 AM

Answers

All replies

  • 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,


    Charlie Liao
    TechNet Community Support

    Friday, September 4, 2015 6:16 AM
  • 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

    Friday, September 4, 2015 8:05 PM