Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
krishna_murthy
Helper II
Helper II

how to combined first name and last name in DAX in semantic model

Hi Team,

 

Just checking how we can achieve on how to combined first name and last name in DAX and we have connected in semantic model

2 ACCEPTED SOLUTIONS
rohit1991
Super User
Super User

Hi @krishna_murthy 

 

If you can edit the semantic model (best for slicers/labels): add a calculated column.

Full Name =
VAR s =
    TRIM( COALESCE('Customers'[FirstName], "") & " " & COALESCE('Customers'[LastName], "") )
RETURN IF( s = "", BLANK(), s )

 

If you’re on a thin report (live connection) and can’t add columns: you can only add a measure (works in cards/tables, not slicers/axes).

Full Name (measure) =
VAR f = SELECTEDVALUE('Customers'[FirstName])
VAR l = SELECTEDVALUE('Customers'[LastName])
VAR s = TRIM( COALESCE(f, "") & " " & COALESCE(l, "") )
RETURN IF( s = "", BLANK(), s )

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

jaineshp
Memorable Member
Memorable Member

Hey @krishna_murthy,

Quick Solution for Combining Names - DAX & Power Query

Hey there! Here are both approaches I use for combining first and last names:

DAX Solution (In Semantic Model)

Step 1: Add Calculated Column Go to your table in the semantic model and create a new calculated column:

 

Full Name = [FirstName] & " " & [LastName]

 

Step 2: Handle Blank Values (Recommended) If you have missing data, use this instead:

 

Full Name =
IF(
ISBLANK([FirstName]) || ISBLANK([LastName]),
COALESCE([FirstName], "") & COALESCE([LastName], ""),
[FirstName] & " " & [LastName]
)

 

Implementation:

  • Right-click your table → New Column
  • Paste the formula and hit Enter
  • Rename if needed

Power Query Solution (Data Transformation)

Method 1: Using Merge Columns

  • Select both FirstName and LastName columns
  • Go to Transform tab → Merge Columns
  • Choose "Space" as separator
  • Name the new column "Full Name"

Method 2: Custom Column Approach Add a custom column with this M formula:

 

= [FirstName] & " " & [LastName]

 

Method 3: Handle Nulls in Power Query For better null handling:

 

= Text.Combine({[FirstName], [LastName]}, " ")

 

The Power Query approach is usually my go-to since it keeps the model cleaner and processes faster during refresh!

 

Fixed? ✓ Mark it • Share it • Help others!


Best Regards,
Jainesh Poojara | Power BI Developer

View solution in original post

2 REPLIES 2
jaineshp
Memorable Member
Memorable Member

Hey @krishna_murthy,

Quick Solution for Combining Names - DAX & Power Query

Hey there! Here are both approaches I use for combining first and last names:

DAX Solution (In Semantic Model)

Step 1: Add Calculated Column Go to your table in the semantic model and create a new calculated column:

 

Full Name = [FirstName] & " " & [LastName]

 

Step 2: Handle Blank Values (Recommended) If you have missing data, use this instead:

 

Full Name =
IF(
ISBLANK([FirstName]) || ISBLANK([LastName]),
COALESCE([FirstName], "") & COALESCE([LastName], ""),
[FirstName] & " " & [LastName]
)

 

Implementation:

  • Right-click your table → New Column
  • Paste the formula and hit Enter
  • Rename if needed

Power Query Solution (Data Transformation)

Method 1: Using Merge Columns

  • Select both FirstName and LastName columns
  • Go to Transform tab → Merge Columns
  • Choose "Space" as separator
  • Name the new column "Full Name"

Method 2: Custom Column Approach Add a custom column with this M formula:

 

= [FirstName] & " " & [LastName]

 

Method 3: Handle Nulls in Power Query For better null handling:

 

= Text.Combine({[FirstName], [LastName]}, " ")

 

The Power Query approach is usually my go-to since it keeps the model cleaner and processes faster during refresh!

 

Fixed? ✓ Mark it • Share it • Help others!


Best Regards,
Jainesh Poojara | Power BI Developer

rohit1991
Super User
Super User

Hi @krishna_murthy 

 

If you can edit the semantic model (best for slicers/labels): add a calculated column.

Full Name =
VAR s =
    TRIM( COALESCE('Customers'[FirstName], "") & " " & COALESCE('Customers'[LastName], "") )
RETURN IF( s = "", BLANK(), s )

 

If you’re on a thin report (live connection) and can’t add columns: you can only add a measure (works in cards/tables, not slicers/axes).

Full Name (measure) =
VAR f = SELECTEDVALUE('Customers'[FirstName])
VAR l = SELECTEDVALUE('Customers'[LastName])
VAR s = TRIM( COALESCE(f, "") & " " & COALESCE(l, "") )
RETURN IF( s = "", BLANK(), s )

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.