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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Adding Columns in existing table

I have 4 rows and 4 column data, to which I have to add extra column and enter text there.

How to do it?

Shall I use M code Table.Addcolumn? What will be the syntax to insert text?

 

I cannot create another table and merge because there is no relation.

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi  @Anonymous ,

You can add a column of Sheet2 in your original Excel, the data in it is your column that is not loaded in, and a primary key column

vyangliumsft_0-1625638510785.png

For example:

Sheet1:

vyangliumsft_1-1625638510786.png

Sheet2: The Score column is not loaded into the column

vyangliumsft_2-1625638510787.png

Use the same ID column as the primary key column, load this Excel into power bi

Here are the steps you can follow:

1. Enter Power query through Transform data, select Home – Merge Queries – Merge Queries.

vyangliumsft_3-1625638510795.png

2. Select the [ID] column of Sheet1 and the [ID] column of Sheet2, and select Join Kind as Left Outer.

vyangliumsft_4-1625638510797.png

3. Select the column to load into.

vyangliumsft_5-1625638510798.png

4. Result:

vyangliumsft_6-1625638510799.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

Anonymous
Not applicable

I made changes into the excel file and the problem is resolved.

 

But, its not possible to add cloumn containing different text for each row in power bi. I didn't find solution for this! 

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi  @Anonymous ,

You can add a column of Sheet2 in your original Excel, the data in it is your column that is not loaded in, and a primary key column

vyangliumsft_0-1625638510785.png

For example:

Sheet1:

vyangliumsft_1-1625638510786.png

Sheet2: The Score column is not loaded into the column

vyangliumsft_2-1625638510787.png

Use the same ID column as the primary key column, load this Excel into power bi

Here are the steps you can follow:

1. Enter Power query through Transform data, select Home – Merge Queries – Merge Queries.

vyangliumsft_3-1625638510795.png

2. Select the [ID] column of Sheet1 and the [ID] column of Sheet2, and select Join Kind as Left Outer.

vyangliumsft_4-1625638510797.png

3. Select the column to load into.

vyangliumsft_5-1625638510798.png

4. Result:

vyangliumsft_6-1625638510799.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Fowmy
Super User
Super User

@Anonymous 

To add a custom column in Power Query, click on the Custom Column under Add Column Tab and enter as follows.

Fowmy_0-1625471954461.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

This adds same text to all the rows. 

I have to add 4 different text to 4 rows.

@Anonymous 

Sorry, your explanation was not clear enough.  If you want to add different text then you need have a condition to check. you can for exmaple use IF as follows 

=if [Column] = "condition" then "your text" else null

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

I dont have a condition here.

 

I imported a excel file and one column which was text was not loaded into query editor. Now, i want to add this column manually.

I cannot create new table and merge it since there is no relation.

Anonymous
Not applicable

I made changes into the excel file and the problem is resolved.

 

But, its not possible to add cloumn containing different text for each row in power bi. I didn't find solution for this! 

amitchandak
Super User
Super User

@Anonymous , create column and add formula based on row value 

 

if [col] =1 then "A" else "B" end

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I dont understand what you are saying.

Do I have to add column in query editor? If yes, then is it custom column?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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