Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello,
I have searched around and couldn't find a similar question.;It might be how I am phrasing my question...
I am trying to join data into a new column. The 2 columns have multiple lines within a cell. When I make a column with a formula, it takes the contents of the first column followed by the second column. I am wanting to take the first line of 1 column and join it with the first line in the 2nd column, then seperate the new column by each line.
Please see below for an example of what I am trying to achieve. I know how to split cells into multiple rows for each line with in a cell, but I am having trouble joining the Xth line of each cell in one column to the xth line from another column.
Data - Current State: | ||
Column A | Column B | |
A3 - Line 1 A3 - Line 2 A3 - Line 3 | B3 - Line 1 B3 - Line 2 B3 - Line 3 | |
Desired Results: | ||
A3 - Line 1 B3 - Line 1 | ||
A3 - Line 2 B3 - Line 2 | ||
A3 - Line 3 B3 - Line 3 |
Solved! Go to Solution.
I got a solution from a coworker. The solution uses text splits by line feeds (Text.Split M Code), creating a table from columns (Table.FromColumns M code), expanding a column, and merging columns (using Text.Combine M code)
Below is the table that served as an example.
Steps for transforming the table:
Final Results:
I got a solution from a coworker. The solution uses text splits by line feeds (Text.Split M Code), creating a table from columns (Table.FromColumns M code), expanding a column, and merging columns (using Text.Combine M code)
Below is the table that served as an example.
Steps for transforming the table:
Final Results:
you need to add one more column to get the desired result,
1. In power query editor go to add column and click custom column and enter the below formula by changing the necessary column names,
[Column A] &" "& [Column B]
2. Desired result,
Thanks,
Arul
Hi Arul,
Thank you for helping me.
One of the problems I have is that there are multiple lines in the 2 columns. When I try the & symbol it just takes Colunm A contents and joins contents from Column B right after Column A's contents.
sorry I did not understand but the above formula should work for all the lines in two columns.
Thanks,
Arul
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
83 | |
69 | |
68 | |
39 | |
37 |