cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pbuser
Helper IV
Helper IV

Add an extra field from a data source

A power bi newbie here. 

Say if I import a table A from a data source into power bi, some minor changes to the imported dataset. calculated columns, measures etc.

Now I add a new field in the table A, how do I include the new field into the data set in power bi (without re-creating a new one)?

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@pbuser

If I didn't misunderstood you, when you refresh in power bi desktop your new added column will automatically be imported.

View solution in original post

47 REPLIES 47
CTom
Regular Visitor

I know this was solved but found an even simpler solution.

 

In power query select the query in question > right click > select advanced editor

On line 1, where it lists your file source, change column = x to column = x + y

where x = the default column number listed

where y = the number of additional columns missing (OP situation would change it from 4 to 5 if the original file had 4 columns and 1 added column so should list as column = 4 to column = 5)

 

 

Anonymous
Not applicable

Hello Community

Does this video (https://youtu.be/YCCMCIktTdQ) by Ruth still stand good as of today to bring in added or deleted columns from Excel Data Source to Power BI without any issues or is there an updated feature or functionality from Microsoft Power BI?

Please let me know because I am in this situation too with business adding and deleting columns in the Excel Data Source.

Hoping to hear from you soon.

Kind regards, B

Thanks for metioning the video, it helped me to get around the newly added column to the dataset (multiple files on the Sharepoint folder combined)

Paulyeo11
Impactful Individual
Impactful Individual


@Anonymous wrote:

Hello Community

Does this video (https://youtu.be/YCCMCIktTdQ) by Ruth still stand good as of today to bring in added or deleted columns from Excel Data Source to Power BI without any issues or is there an updated feature or functionality from Microsoft Power BI?

Please let me know because I am in this situation too with business adding and deleting columns in the Excel Data Source.

Hoping to hear from you soon.

Kind regards, B


Hi All

 

i also have the same problem. 

paul

kwdavis7
Regular Visitor

Think I found why this wasn't working for my updated CSV file. In the Advanced Editor window the first line of code list how many columns the query is reading on the source. I had to increase that number to the new total columns in the csv in addition to adding the column names to the query.  Afterwards, a simple refresh did the trick.

Anonymous
Not applicable

I have the same issue here. Unfortunately, nothing discussed here worked for me. My data source is a folder filled with CSV files. I added a new column which I need for another visual. How can I see the new one after refreshing the source?

Hi bon_lenard,

 

Can you please add a print screen of the PB editor, so we could se the situation?

 

Grtz

Anonymous
Not applicable

Can someone please post some screenshots or a link to guide me (and anyone in my situation) on how to get additional columns/fields from a .CSV spreadsheet to Power BI without affecting my existing data model and reports? I'm stuck with the same issue and did not find your steps actionable in my PBIX. I'm on Version: 2.75.5649.861 64-bit (November 2019).

Thanks in advance.

Kind regards, B

KelvinMorel
Helper II
Helper II

Hi,

 

I know this post is marked as Solved, I just want to add my experiance on this issue.

 

When you add a column to the data source file, on Power BI or Power Query into 'Query Editor' you should Refresh All but after that nothing will change because your column selection refers to the first source file you loaded and is being used as 'Sample File'.

A new 'Sample File' will be created under 'Transform File from Data' (on the left Queries [#] column).

 

To solve this issue just choose the right 'Sample File' in the 'Manage Parameters' menu

 

SNAG-0192.jpg

Anonymous
Not applicable

In case someone else finds help from this:

 

I have a API that has simple JSON data in one level. The new column wouldn't show for me with refresh. The solution to my problem was to edit the "Expanded Column1". The new column was not selected there, and I just selected the new column and it was ready to use. 

 

However, if anyone has an idea how to update more automatically (like just with clicking "Refresh Preview") I would be happy to try it out.

Agree with others.  MS needs to make an automatic check for new columns of data and ask you what you want to do with them.  Tableau pulls them in automatically and they are just there in case you want to use them.

YasarKhan
Frequent Visitor

Hi All,

 

I have connected SSAS Cubes to Power BI.

 

While preparing the report, I selected some of the required field from one of the SSAS Cube Package.

 

Now I want to add extra field from the same SSAS Cube package, How can I do that?

 

Thanks,

YasarKhan
Frequent Visitor

Hi All,

 

I have the same issue while I want to extract column from SSAS Analysis Cube.

 

What I did:

I connected SSAS Cube by Get Data..Then I select some specific fields based on my requirement from one of the package(A package consisit many fields).

 

Now, How can I add one extra field from the package???

 

Thanks,

 

 

AlexanderZ
Regular Visitor

I have data in a flat azure table with 80 columns. When I getting this data to power bi it analyze only 1000 first rows and automatically creates fields. The problem is that first 1000 columns contain just 25 collumns and bi automaticaly creates not full structure. How I can manualy set data scheme and specify all fields manually?

Thx!

SNV
Helper I
Helper I

I also have the same problem as the topic starter.

 

Both the proposed solutions work for me, changing the column amount in the advanced editor and switching the source to automatic.

 

But is there a possibility to make the number of the amount of columns in the advanced editor a variable?

So before the data is imported, the columns are counted in the source, stored as a variable and then with the import source step the variable is put after the columns

 

Ex.  [Delimiter=";", Columns=X, Encoding=1252, Quotestyle=Quotestyle.None]),

 

Where X is the counted variable.

 

Maybe this could automate the 2 solutions, if it is possible

SabineOussi
Skilled Sharer
Skilled Sharer

Make sure you have saved your spreadsheet before refreshing in Power BI.

Refreshing columns that are already there is no problem. Getting the new columns included is though.

I had the same issue.  My source is a URL that returns a CSV.  When the owner of the URL (a vendor) adds a new column to the CSV, PowerBI does NOT detect the new column.

 

I have gone into Edit queries -> Refresh Preview.

 

I can copy / paste the URL from the "Source" of the query into a browser and the CSV that returns has the new column.

 

However, looking in PowerBI...even clicking on the "Source" in the "Applied Steps" so that NOTHING has been done with the source data - no columns hidden, etc - the new column is NOT there.

 

If I change the URL to nonsense, save, then re-paste the URL into the source it will then find the new columns.  A clumsy forced refresh.  Should be a better way.

Anonymous
Not applicable

I want  to add a new column to power bi from a data Cube without changing anything in the data cube.Is it possible to add new column to power Bi without modifiying in Data Cube.

 

Please let me know...

I have this issue also and it is very frustrating. We add addional columns and fields to source csvs all the time.

 

I have a work around that used to work...until today.

 

This way you will not lose any of your steps, which is very important especially if you have a complicated report that could break.

 

The work around is this:

 

1) refresh everything, make sure the new column is in the source csv

2) under applied steps in query editor, go to source and hit the settings gear icon to right of "source"

3) Choose Open file as "Automatic" hit OK

4) Your table will dissappear, double click the csv file icon, hit "insert" when the insert step box pops up

5) Your newly added column will appear at step 1 "source"

6) to make sure it stays , under "choose columns" or if you have a "removed columns" ...make sure the check box for that new column is checked

7) Your column is good to go now

 

This usually works. Except today it started giving me a wierd error after applying query edits Which is why I am here searching.

 

EDIT* I fixed my error. I was being dumb. My work around works again.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors