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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Jojojojo
Frequent Visitor

How do you append multiple columns into one column?

Hi there,

I'm pretty new to Power Query and am looking to append 5 diffrent columns into one.

From my formula below, the new column only seems to populate data from the columns ([Initiative Description] and [#"MAT - Initiative Description"].
While the other 3 columns  [#"ENG - Initiative description"], [#"WAT -Initiative description"] & [#"OTH - Initiative description"] are coming out as null's. 

= Table.AddColumn(#"Added Custom3", "Initiative Description All", each if [Initiative Description] = null then [#"MAT - Initiative Description"]
else if [Initiative Description] = null and [#"MAT - Initiative Description"] = null then [#"ENG - Initiative description"]
else if [Initiative Description] = null and [#"MAT - Initiative Description"] = null and [#"ENG - Initiative description"] = null then [#"WAT -Initiative description"] else if [Initiative Description] = null and [#"MAT - Initiative Description"] = null and [#"ENG - Initiative description"] = null and [#"WAT -Initiative description"] = null then [#"OTH - Initiative description"] else [Initiative Description])

Jojojojo_1-1665537792410.png



Hope someone can help out,

Thanks,

Jo

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

If I'm understanding correctly, this seems like a good use case for the coalesce operator.

[Initiative Description] ?? [#"MAT - Initiative Description"] ?? [#"ENG - Initiative description"] ?? [#"WAT -Initiative description"] ?? [#"OTH - Initiative description"]

 

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

If I'm understanding correctly, this seems like a good use case for the coalesce operator.

[Initiative Description] ?? [#"MAT - Initiative Description"] ?? [#"ENG - Initiative description"] ?? [#"WAT -Initiative description"] ?? [#"OTH - Initiative description"]

 

Thanks this worked for me! Followed what was on the post and wrote it out like:

= Table.AddColumn(#"Added Custom3", "Initiative Description All", each
if [Initiative Description] <> null then [Initiative Description]
else if [#"MAT - Initiative Description"] <> null then [#"MAT - Initiative Description"]
else if [#"ENG - Initiative description"] <> null then [#"ENG - Initiative description"]

else if [#"WAT -Initiative description"] <> null then [#"WAT -Initiative description"]

else if [#"WAT -Initiative description"] <> null then [#"WAT -Initiative description"]

else if [#"OTH - Initiative description"] <> null then [#"OTH - Initiative description"] else "N/A")

wdx223_Daniel
Community Champion
Community Champion

=let col=List.Select(Table.ColumnNames(#"Added Custom3"),each Text.EndsWith(_,"Initiative Description",Comparer.OrdinalIgnoreCase)) in Table.AddColumn(#"Added Custom3","Initiative Descriptin All",each List.RemoveNulls(Record.ToList(Record.SelectFields(_,col))){0}?)

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.