cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Add a column in Power BI existing table

Hi All,

 

I have a table and I want to add a coulmn in that table Suppose Column_Flag in TableA.

 

Also I want to insert a charcter in each row of Column_Flag.

Menas Cloumn_Flag=A  .

 

Whenever a new record comes in TableA then it will automatically insert Cloumn_Flag=A against that new record.

 

 

Please let me know , How to achieve this.

 

 

Thanks,

 

Narender

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: Add a column in Power BI existing table

Hi @Narender,

If this new column to be added is not based on Any Conditions, i.e. If all the Entries in Column_Flag will be equal to 'A', just that the colmn should be automatically populated whenever new data comes, then you can achieve it using "Column From Examples" option in the Add Column of the Power Query Ribbon. Sames is show in the below pics

Add Column from ExampleAdd Column from ExampleYou just directly specify a Character for it to be repeated in all rowsYou just directly specify a Character for it to be repeated in all rows

 

 

 

 Hope this solves your issue!!!

 

 

View solution in original post

7 REPLIES 7
Highlighted
Solution Sage
Solution Sage

Re: Add a column in Power BI existing table

Hi @Narender,

If this new column to be added is not based on Any Conditions, i.e. If all the Entries in Column_Flag will be equal to 'A', just that the colmn should be automatically populated whenever new data comes, then you can achieve it using "Column From Examples" option in the Add Column of the Power Query Ribbon. Sames is show in the below pics

Add Column from ExampleAdd Column from ExampleYou just directly specify a Character for it to be repeated in all rowsYou just directly specify a Character for it to be repeated in all rows

 

 

 

 Hope this solves your issue!!!

 

 

View solution in original post

Highlighted
Solution Sage
Solution Sage

Re: Add a column in Power BI existing table

PowerQuery (get data) does not retain or archive older data so it has no way to tell if the record is old or new.  This needs to be handled with whatever system is creating the records. I usually request they add a Creation_Date and/or Modificaton_Date on each records. If you have that you can use filters adn time inteligence to compare against baseline, identify new records created within the last x days or whatever your trying to do.

Highlighted
Resolver I
Resolver I

Re: Add a column in Power BI existing table

Hi Thejeswar,

 

I did the same . But I saw there is some different value P found in my new created column but in actual i inserted the A.

 

So some places i found P rather than A

 

Due to this i am not getting my correct data.

 

 

Thanks,

 

Narender

Highlighted
Solution Sage
Solution Sage

Re: Add a column in Power BI existing table

Hi @Narender,

I tried recreating your scenario, but I was not able to. How many ever columns I insert, the same A is getting populated in all records.

 

Ideally, unless you specify some pattern for your data, all the rows will be populated as 'A' undoubtedly.

 

In case if you are importing data using SQL Query from a Database, you can also specify there, a new column with a static value of 'A'

Highlighted
Resolver I
Resolver I

Re: Add a column in Power BI existing table

Hi Thejeshwar,

 

I did the same. But find a P value also.

 

So now I am trying to delete the new column and creating again.

 

I need to add this new column because i want to append this table with other table. For distinguish , I am using this new column as a flag. 

 

Thanks,

 

Narender

Highlighted
Resolver I
Resolver I

Re: Add a column in Power BI existing table

HiSwerd,

 

I am using this for other Purpose.

 

I need to add this new column because i want to append this table with other table. For distinguish , I am using this new column as a flag.

 

 

Thanls,

 

Narender

Highlighted
Solution Sage
Solution Sage

Re: Add a column in Power BI existing table

What is the M code for the step that is inserting the A? If you don’t have the formula bar on you can turn it on under view ribbon. Or it may just be better if you paste your query? To do those choose advanced editor from the main ribbon.

Rather than using column from examples just add column with “A” in the formula window.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors