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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Renaming multiple columns after API import

Hi 

I have imported a API request to PowerBi. All fine. 

I can see the import have predefine the colunm name with "Value." and name ect. "Value.dashboard"

 

bajlumbusch_0-1615891252725.png

 

It's possible to automatic renaming multiple columns and remove "Column." in the column name? There is over 50 columns I need to remove. Thanks.  

 

Data in Power Query 

let
Kilde = Json.Document(Web.Contents("https://geniebelt.letsbuild.com/api/mulan/projects", [Headers=[Authorization="API-KEY"]])),
#"Konverteret til tabel" = Record.ToTable(Kilde),
#"Udvidet Value" = Table.ExpandListColumn(#"Konverteret til tabel", "Value"),
#"Udvidet Value1" = Table.ExpandRecordColumn(#"Udvidet Value", "Value", {"dashboard_image_url", "subscription_plan_code", "subscription_type", "estimated_progress", "logo_image_url", "work_duration", "estimated_latitude", "estimated_longitude", "company_id", "partner", "default_team_id", "attachments_ids", "country_calendar", "id", "updated_at", "created_at", "name", "owner_id", "ticket_number", "project_description", "budget", "start_date", "end_date", "progress", "cover_attachment_id", "project_subscription_id", "archived_at", "logo_attachment_id", "latitude", "longitude", "address", "timezone", "estimated_address", "locked", "reference", "custom_settings", "custom_fields", "hash", "owner", "attachments"}, {"Value.dashboard_image_url", "Value.subscription_plan_code", "Value.subscription_type", "Value.estimated_progress", "Value.logo_image_url", "Value.work_duration", "Value.estimated_latitude", "Value.estimated_longitude", "Value.company_id", "Value.partner", "Value.default_team_id", "Value.attachments_ids", "Value.country_calendar", "Value.id", "Value.updated_at", "Value.created_at", "Value.name", "Value.owner_id", "Value.ticket_number", "Value.project_description", "Value.budget", "Value.start_date", "Value.end_date", "Value.progress", "Value.cover_attachment_id", "Value.project_subscription_id", "Value.archived_at", "Value.logo_attachment_id", "Value.latitude", "Value.longitude", "Value.address", "Value.timezone", "Value.estimated_address", "Value.locked", "Value.reference", "Value.custom_settings", "Value.custom_fields", "Value.hash", "Value.owner", "Value.attachments"}),
#"Udvidet Value.owner" = Table.ExpandRecordColumn(#"Udvidet Value1", "Value.owner", {"company_name", "company_id", "profile_picture_url", "profile_picture_medium_url", "attachments_ids", "language", "phone_number_formatted", "last_sign_in_at", "confirmed_at", "unconfirmed_email", "partner", "id", "updated_at", "created_at", "email", "phone_number", "first_name", "last_name", "hash", "attachments"}, {"Value.owner.company_name", "Value.owner.company_id", "Value.owner.profile_picture_url", "Value.owner.profile_picture_medium_url", "Value.owner.attachments_ids", "Value.owner.language", "Value.owner.phone_number_formatted", "Value.owner.last_sign_in_at", "Value.owner.confirmed_at", "Value.owner.unconfirmed_email", "Value.owner.partner", "Value.owner.id", "Value.owner.updated_at", "Value.owner.created_at", "Value.owner.email", "Value.owner.phone_number", "Value.owner.first_name", "Value.owner.last_name", "Value.owner.hash", "Value.owner.attachments"}),
#"Udvidet Value.owner.attachments" = Table.ExpandListColumn(#"Udvidet Value.owner", "Value.owner.attachments"),
#"Udvidet Value.attachments" = Table.ExpandListColumn(#"Udvidet Value.owner.attachments", "Value.attachments")
in
#"Udvidet Value.attachments"

2 REPLIES 2
Anonymous
Not applicable

try this (warning: not tested!!!)

 

let
Kilde = Json.Document(Web.Contents("https://geniebelt.letsbuild.com/api/mulan/projects", [Headers=[Authorization="API-KEY"]])),
#"Konverteret til tabel" = Record.ToTable(Kilde),
#"Udvidet Value" = Table.ExpandListColumn(#"Konverteret til tabel", "Value"),
#"Udvidet Value1" = Table.ExpandRecordColumn(#"Udvidet Value", "Value", {"dashboard_image_url", "subscription_plan_code", "subscription_type", "estimated_progress", "logo_image_url", "work_duration", "estimated_latitude", "estimated_longitude", "company_id", "partner", "default_team_id", "attachments_ids", "country_calendar", "id", "updated_at", "created_at", "name", "owner_id", "ticket_number", "project_description", "budget", "start_date", "end_date", "progress", "cover_attachment_id", "project_subscription_id", "archived_at", "logo_attachment_id", "latitude", "longitude", "address", "timezone", "estimated_address", "locked", "reference", "custom_settings", "custom_fields", "hash", "owner", "attachments”}),
#"Udvidet Value.owner" = Table.ExpandRecordColumn(#"Udvidet Value1", "Value.owner", {"company_name", "company_id", "profile_picture_url", "profile_picture_medium_url", "attachments_ids", "language", "phone_number_formatted", "last_sign_in_at", "confirmed_at", "unconfirmed_email", "partner", "id", "updated_at", "created_at", "email", "phone_number", "first_name", "last_name", "hash", "attachments"} ),
#"Udvidet Value.owner.attachments" = Table.ExpandListColumn(#"Udvidet Value.owner", "Value.owner.attachments"),
#"Udvidet Value.attachments" = Table.ExpandListColumn(#"Udvidet Value.owner.attachments", "Value.attachments")
in
#"Udvidet Value.attachments"
edhans
Community Champion
Community Champion

I'm not 100% clear on what you need to do @Anonymous but you should not "Remove Columns" here. You should "Remove Other Columns" which is to say, Power Query will use Table.SelectColumns. In other words, keep what you want, and the rest will be discarded.

 

If you want to rename columns dynamically based on their position if you don't know their incoming name all of the time, you can take a look at this blog I wrote that will help you explain it.

 

Otherwise, we will need to see some data and expected results. And when pasting code, please use the code box in the 2nd toolbar ribbon - </>

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.