Forum Discussion
replacing source file having different column names.
Hi ,
I am replacing a .csv file with a SQL Table in Power BI. I have replaced it without issues. However, the column names are different between the .csv file and SQL Table. Also I should not rename my SQL columns to match the .csv file!!
I have multiple pages of visual and manually going around and replacing the columns is arduous!!
- Anonymous4 years ago
Hi NidhiBhusari,
If you are working with SQL data source, you can enable the advanced option to write t-SQL statement to do rename operations on the result tables. AFAIK, these operations work on the return data and do not affect the database table structures.
Power Query SQL Server connector - Power Query | Microsoft Docs
Regards,Xiaoxin Sheng
3 Replies
- amitchandakSuper User
NidhiBhusari , I am assuming you are shifting from csv to excel or vice version.
Add the new source as new table, rename columns to make sure it matches with old source.
Then take this code and replace it on top to old code, match the table name in next step
#"Rename column" might be step
in next step the check the table name used and use this one
- NidhiBhusariHelper IV
Hi amitchandak ,
I have a Power BI Table which has a .csv file as Data Source.
It has columns: Customer ID, Date, Sales, UnitsI am now replacing this with a SQL Table with columns as : cm_id, t_date, revenue, qtyI now want to ensure my visuals don't get errors also I don't want to rename cm_id to Customer ID- AnonymousNot applicable
Hi NidhiBhusari,
If you are working with SQL data source, you can enable the advanced option to write t-SQL statement to do rename operations on the result tables. AFAIK, these operations work on the return data and do not affect the database table structures.
Power Query SQL Server connector - Power Query | Microsoft Docs
Regards,Xiaoxin Sheng