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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sandypigili0724
New Member

Need help-By using disconnected table, how can we concatenate columns dynamically using DAX

we have table with below columns.

sandypigili0724_0-1669819121355.png

by using dax we concatinated the above columns with proper spacing

Concat =
var Str = "                                                                                                    "
// var Tab =
var Concat1 = REPLACE(Str, 1, LEN('Customer Record'[Policy Number]), 'Customer Record'[Policy Number])
var Concat2 = REPLACE(Concat1, 25, LEN('Customer Record'[Customer Name]), 'Customer Record'[Customer Name])
var Concat3 = REPLACE(Concat2, 50, LEN('Customer Record'[Customer Primary City]), 'Customer Record'[Customer Primary City])
var Concat4 = REPLACE(Concat3, 75, LEN('Customer Record'[Customer Primary County]), 'Customer Record'[Customer Primary County])
return
Concat4
// 'Customer Record'[Policy Number] & "|" & 'Customer Record'[Customer Name] & "|" & 'Customer Record'[Customer Primary City] & "|" & 'Customer Record'[Customer Primary County]
below is the output for the above logic;
sandypigili0724_1-1669819528927.png

And created the disconnected table/data table(

Table =
DATATABLE(
"Column Name", STRING,
"Start Index", INTEGER,
"Length", INTEGER,
    {
        {"Policy Number", 1, 10},
        {"Customer Name", 11, 10},
        {"Customer Primary City", 21, 10},
        {"Customer Primary County", 31, 10}
    }
 )

)

"using the above table logic, we need to concatinate the above four columns dynamically using DAX"

Can any one please help me in this requirement.

 

Thanks in Advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sandypigili0724 ,

You can create a calculated column as below to get it, it is no required to refer that disconnected table...

Concat = 
VAR Str = "          "
RETURN
    'Customer Record'[Policy Number] & str & 'Customer Record'[Customer Name] & Str & 'Customer Record'[Customer Primary City] & Str & 'Customer Record'[Customer Primary County]

yingyinr_0-1670296924312.png

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @sandypigili0724 ,

You can create a calculated column as below to get it, it is no required to refer that disconnected table...

Concat = 
VAR Str = "          "
RETURN
    'Customer Record'[Policy Number] & str & 'Customer Record'[Customer Name] & Str & 'Customer Record'[Customer Primary City] & Str & 'Customer Record'[Customer Primary County]

yingyinr_0-1670296924312.png

Best Regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.