Power BI
Master text concatenation in Power BI using DAX functions including ampersand operator, CONCATENATE, and CONCATENATEX. Includes 15+ real-world examples from Fortune 500 implementations with performance optimization techniques.

Text concatenation in Power BI involves combining multiple text values into a single string. Whether you're building customer names from first and last name fields, creating custom labels, or merging address components, mastering concatenation is essential for data modeling.
After implementing Power BI across 500+ Fortune 500 engagements, EPC Group has identified the patterns, pitfalls, and performance optimizations that separate amateur implementations from enterprise-grade solutions.
The simplest concatenation approach uses the & operator:
Full Name = [First Name] & " " & [Last Name]
When to Use:
Real-World Example from Healthcare Client:
Patient Identifier =
[Patient Last Name] & ", " &
[Patient First Name] & " (DOB: " &
FORMAT([Date of Birth], "MM/DD/YYYY") & ")"
Result: "Smith, John (DOB: 03/15/1975)"
DAX's CONCATENATE function handles two strings:
Full Name = CONCATENATE([First Name], CONCATENATE(" ", [Last Name]))
Limitations:
When to Use: Rarely. The & operator provides better readability.
CONCATENATEX iterates over tables and concatenates with delimiters:
All Products =
CONCATENATEX(
Products,
[Product Name],
", ",
[Product Name],
ASC
)
Parameters:
Performance Considerations:
Problem: Blank values create unwanted spaces or delimiters.
Solution: Use IF or ISBLANK:
Full Address =
VAR Street = [Street Address]
VAR Suite = [Suite Number]
VAR City = [City]
VAR State = [State]
VAR Zip = [Postal Code]
RETURN
Street &
IF(NOT(ISBLANK(Suite)), ", " & Suite, "") &
", " & City & ", " & State & " " & Zip
Use Case: Different formats based on conditions.
Customer Display =
IF(
[Customer Type] = "Business",
[Company Name] & " (Contact: " & [Contact Name] & ")",
[First Name] & " " & [Last Name]
)
Use Case: Show all products in an order.
Order Products =
CONCATENATEX(
RELATEDTABLE(OrderDetails),
RELATED(Products[Product Name]) & " (Qty: " & [Quantity] & ")",
"; ",
RELATED(Products[Product Name]),
ASC
)
Result: "Widget A (Qty: 5); Widget B (Qty: 3); Premium Service (Qty: 1)"
Best Practice: Use variables for readability and performance:
Enhanced Product Description =
VAR ProductName = [Product Name]
VAR Category = RELATED(Categories[Category Name])
VAR Supplier = RELATED(Suppliers[Company Name])
VAR Price = FORMAT([Unit Price], "$#,##0.00")
VAR Stock = [Units In Stock]
RETURN
ProductName & " | " &
Category & " | " &
"Supplier: " & Supplier & " | " &
"Price: " & Price & " | " &
"Stock: " & Stock
Calculated Columns:
Measures:
Recommendation: Use calculated columns for frequently-used concatenations displayed in tables/slicers. Use measures for dynamic, context-dependent concatenations.
Better Performance:
Power Query (M):
#"Added Full Name" = Table.AddColumn(
#"Previous Step",
"Full Name",
each [First Name] & " " & [Last Name],
type text
)
Advantages:
Use When: The concatenation logic is static and doesn't require runtime context.
Problem: CONCATENATEX over large tables kills performance.
Bad:
All Customer Products =
CONCATENATEX(
FILTER(
ALL(Sales),
[Customer ID] = EARLIER([Customer ID])
),
RELATED(Products[Product Name]),
", "
)
Better:
All Customer Products =
CONCATENATEX(
RELATEDTABLE(Sales),
RELATED(Products[Product Name]),
", "
)
Performance Improvement: 10-100x faster by using RELATEDTABLE instead of FILTER(ALL()).
Requirement: Display transaction descriptions with account, date, and amount.
Transaction Summary =
VAR AccountNum = FORMAT([Account Number], "0000")
VAR TranDate = FORMAT([Transaction Date], "MM/DD/YYYY")
VAR Amount = FORMAT([Amount], "$#,##0.00")
VAR Type = [Transaction Type]
RETURN
"Acct " & AccountNum & " | " &
TranDate & " | " &
Type & " | " &
Amount
Requirement: HIPAA-compliant patient identifiers without PHI.
Patient Identifier =
VAR LastInitial = LEFT([Last Name], 1)
VAR FirstInitial = LEFT([First Name], 1)
VAR DOBYear = YEAR([Date of Birth])
VAR MRNLast4 = RIGHT([Medical Record Number], 4)
RETURN
LastInitial & FirstInitial & "-" & DOBYear & "-" & MRNLast4
Result: "JS-1975-8432" (de-identified for reports)
Requirement: Generate SKUs from category, size, color.
SKU =
LEFT([Category Code], 3) & "-" &
[Size Code] & "-" &
[Color Code] & "-" &
FORMAT([Product ID], "0000")
Cause: Attempting to concatenate non-text types.
Solution: Use FORMAT or TEXT:
Description = [Product Name] & " - Qty: " & FORMAT([Quantity], "0")
Cause: CONCATENATEX expression returns multiple columns.
Solution: Explicitly reference single column:
// Wrong
CONCATENATEX(Products, Products, ", ")
// Right
CONCATENATEX(Products, Products[Product Name], ", ")
Cause: Calculated column references itself through relationships.
Solution: Use variables or restructure dependencies:
Full Name =
VAR FirstName = [First Name]
VAR LastName = [Last Name]
RETURN FirstName & " " & LastName
Text concatenation in Power BI ranges from simple & operators to complex CONCATENATEX iterations. The key to enterprise-grade implementations is choosing the right approach for your use case:
After 5,200+ Power BI projects, EPC Group has learned that the difference between a working solution and an enterprise solution lies in these optimization patterns.
Need help optimizing your Power BI data model for performance at scale? EPC Group specializes in enterprise Power BI implementations for Fortune 500 companies. Contact us for a technical assessment.
Chief AI Architect & CEO
28+ years Microsoft consulting experience, bestselling Microsoft Press author
View Full ProfileLearn to use SWITCH and SWITCH(TRUE()) for complex conditional logic in Power BI. Includes performance comparisons vs. nested IF, real-world enterprise examples, and optimization techniques for large datasets.
Power BIMaster enterprise Power BI dashboard design with proven best practices from 500+ Fortune 500 implementations. Learn layout strategies, color theory, performance optimization, and user experience principles.
Power BIMaster Power BI Row-Level Security (RLS) for HIPAA-compliant healthcare analytics. Complete guide with DAX patterns, dynamic security, testing protocols, and real-world implementations for multi-tenant environments.
Our team of experts can help you implement enterprise-grade power bi solutions tailored to your organization's needs.