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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Power BI - updated colums automatically

say I have Get Data from CSV, and loaded into the Power BI.

say next time, I need to add in a few more columns, do I need to remove that table and redo everything again?

Can I if Refresh data, it will add in those new columns, without me remove that table loaded previously?

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

There are several ways you can add columns to your already loaded query. 

Via Power Query using 'M'  -  you can use the Custom Column and build your custom column.

Via Power BI Desktop using DAX - you can create a calculated column. 

 

Based on your requirement and level of familiarity with either languages you can add columns accordingly. DAX is generally more familiar to excel users, while M is more familiar with C # users. 

 

Hope this helps, please give thumbs up and Mark my answers as solution for your question. Thanks!









View solution in original post

5 REPLIES 5
danextian
Super User
Super User

Hi @Anonymous ,

Csv.Document has the following syntax

Csv.Document(source as any, optional columns as any, optional delimiter as any, optional extraValues as nullable number, optional encoding as nullable number)

As indicated in the syntax, optional columns is optional so the M-Script below can be written without the Column parameter.
= Csv.Document(File.Contents("complete path"),[Delimiter=",", Columns=5, Encoding=65001, QuoteStyle=QuoteStyle.None])

= Csv.Document(File.Contents("complete path"),[Delimiter=",", Encoding=65001, QuoteStyle=QuoteStyle.None])

I did several tests and the data previews looked fine without the Column parameter.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
dhruvinushah
Responsive Resident
Responsive Resident

Hi @Anonymous , 
I have faced this before. It is important to understand that Power BI has different methods in which it internally gets data from different sources like csv, SQL Server, DBs etc. 
For the csv, if you have new columns created AFTER you completed the first load into Power BI, your refreshing of the query or the dataset will NOT reflect those new columns. 
Why? beause in the first / initial load of the csv files, the connection will be written to include a 'Column' count. You can check this in the Advanced Editor. You can change that value to new count of columns you have in your csv to get in the new columns of your csv data file. 

Run Refresh after changing the advanced editor query and you will be able to 'refresh' your csv power bi table with the newly added columns. 

 

Hope this helps, please give thumbs up if it did. Thanks!









Anonymous
Not applicable

I have to add in Column by Index and rename that column. Thanks.

Anonymous
Not applicable

I know there is Add Column in Power Query Editor, but what if I want to add in new column which is just another new column that is not related to another other columns?

Hi @Anonymous ,

 

There are several ways you can add columns to your already loaded query. 

Via Power Query using 'M'  -  you can use the Custom Column and build your custom column.

Via Power BI Desktop using DAX - you can create a calculated column. 

 

Based on your requirement and level of familiarity with either languages you can add columns accordingly. DAX is generally more familiar to excel users, while M is more familiar with C # users. 

 

Hope this helps, please give thumbs up and Mark my answers as solution for your question. Thanks!









Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.