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
jcastr02
Post Prodigy
Post Prodigy

joining columns together (name)

Names.png

I had a first name and last name column which I joined to "Name of team member", and then did a split column since the team members middle initial   was at beginning of last name ex.   Amy west  was showing as   M.West, Amy.    Is there a way I can join into a new column   "name of team member.1" and "name of team member.2"?  see pic above  thank you. 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi @jcastr02 ,

 

You need 2 measures as below:

 

Name of team member 1 =
VAR a =
    ISERROR ( SEARCH ( ".", SELECTEDVALUE ( 'Table'[Last Name] ) ) )
RETURN
    IF (
        a = TRUE (),
        CONCATENATE (
            SELECTEDVALUE ( 'Table'[Last Name] ) & ",",
            SELECTEDVALUE ( 'Table'[First Name] )
        ),
        LEFT ( SELECTEDVALUE ( 'Table'[Last Name] ), 1 )
    )
Name of team member 2 =
VAR a =
    ISERROR ( SEARCH ( ".", SELECTEDVALUE ( 'Table'[Last Name] ) ) )
VAR b =
    LEN ( SELECTEDVALUE ( 'Table'[Last Name] ) )
        - SEARCH ( ".", SELECTEDVALUE ( 'Table'[Last Name] ),, 0 )
VAR c =
    RIGHT ( SELECTEDVALUE ( 'Table'[Last Name] ), b )
RETURN
    IF (
        a = FALSE (),
        CONCATENATE ( c & ",", SELECTEDVALUE ( 'Table'[First Name] ) ),
        BLANK ()
    )

 

 

Finally you will see:

 

Untitled.png

 

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

 

 

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi @jcastr02 ,

 

You need 2 measures as below:

 

Name of team member 1 =
VAR a =
    ISERROR ( SEARCH ( ".", SELECTEDVALUE ( 'Table'[Last Name] ) ) )
RETURN
    IF (
        a = TRUE (),
        CONCATENATE (
            SELECTEDVALUE ( 'Table'[Last Name] ) & ",",
            SELECTEDVALUE ( 'Table'[First Name] )
        ),
        LEFT ( SELECTEDVALUE ( 'Table'[Last Name] ), 1 )
    )
Name of team member 2 =
VAR a =
    ISERROR ( SEARCH ( ".", SELECTEDVALUE ( 'Table'[Last Name] ) ) )
VAR b =
    LEN ( SELECTEDVALUE ( 'Table'[Last Name] ) )
        - SEARCH ( ".", SELECTEDVALUE ( 'Table'[Last Name] ),, 0 )
VAR c =
    RIGHT ( SELECTEDVALUE ( 'Table'[Last Name] ), b )
RETURN
    IF (
        a = FALSE (),
        CONCATENATE ( c & ",", SELECTEDVALUE ( 'Table'[First Name] ) ),
        BLANK ()
    )

 

 

Finally you will see:

 

Untitled.png

 

For the related .pbix file,pls click here.

 

Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

 

 

amitchandak
Super User
Super User

@amitchandak  How can I just get value that has the name into one column?  If I concatenate, it will bring the values together, example west, amy should just show  in new column as West, Amy     (want to it disregard the "m")

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.