Pinterest Pixel

Import Data from XML Using Power Query or Get & Transform

Bryan
Power Query or Get & Transform (In Excel 2016) lets you perform a series of steps to transform your Excel data.
But what if your data source is not in your Excel spreadsheet? It's very common nowadays to get data imported from a company's accounting or sales system in the XML format.  If it's inside a XML (extensible markup language) file, it's very easy to import data from xml and right into Power Query!  

Power Query or Get & Transform (In Excel 2016) lets you perform a series of steps to transform your Excel data. But what if your data source is not in your Excel spreadsheet? It’s very common nowadays to get data imported from a company’s accounting or sales system in the XML format.  If it’s inside a XML (extensible markup language) file, it’s very easy to import data from xml and right into Power Query!  

Key Takeaways

  • Power Query Makes XML Import SimpleEasily connect to and transform XML data into structured tables with just a few clicks.

  • Flexible Data Shaping OptionsFilter, expand, and reshape nested XML elements to match your analysis needs.

  • Supports Both Local and Web XML FilesYou can import XML files from your computer or from an online URL.

  • Refreshable Data SourceOnce set up, your XML query can be refreshed automatically to bring in updated data.

  • Ideal for Repetitive Data ImportsGreat for recurring tasks like pulling data from system exports or online feeds.

Our Data Set

Let’s suppose you have this set of data from the xml file:

Import Data from XML Using Power Query or Get & Transform

How to Import Data from XML Using Power Query or Get & Transform

STEP 1:

Using Excel 2016 (screenshot below)

Go to Data > New Query > From File > From XML

Using Excel 2013 or Excel 2010

Go to Power Query > From File > From XML

Import Data from XML Using Power Query or Get & Transform

Select the xml file that contains the data.  Click Import.

Import Data from XML Using Power Query or Get & Transform

Select the XML Data Source.  A preview of the xml data will be shown.  If it looks good, press Edit.

Import Data from XML Using Power Query or Get & Transform

 

STEP 2: This will open up the Power Query Editor.  You can now perform your data manipulation here but we will keep the data as is.

Click Close & Load from the Home tab and this will open up a brand new worksheet in your Excel workbook with the imported table.

Import Data from XML Using Power Query or Get & Transform

You now have your new table from the xml file!

Import Data from XML Using Power Query or Get & Transform

 

Frequently Asked Questions

Where can I find the XML import option in Excel?
Go to the Data tab → Get DataFrom FileFrom XML, or use From Web if the file is hosted online.

Can I transform nested XML structures into flat tables?
Yes, Power Query lets you expand nested elements and convert them into a structured, tabular format.

Is Power Query available in all Excel versions?
Power Query is built-in from Excel 2016 onward and available as an add-in in Excel 2010 and 2013.

Can I refresh the XML data after importing?
Absolutely. You can refresh the query to pull in new data from the same XML source.

What if my XML data doesn’t load correctly?
Make sure the XML is well-formed. Power Query may not process malformed XML files; use a validator to check the format.

If you like this Excel tip, please share it



Import Data from XML Using Power Query or Get & Transform | MyExcelOnline


Bryan

Bryan Hong is an IT Software Developer for more than 10 years and has the following certifications: Microsoft Certified Professional Developer (MCPD): Web Developer, Microsoft Certified Technology Specialist (MCTS): Windows Applications, Microsoft Certified Systems Engineer (MCSE) and Microsoft Certified Systems Administrator (MCSA).

He is also an Amazon #1 bestselling author of 4 Microsoft Excel books and a teacher of Microsoft Excel & Office at the MyExecelOnline Academy Online Course.

See also  Fill Down Values Using Power Query

Star 30 Days - Full Access Star

One Dollar Trial

$1 Trial for 30 days!

Access for $1

Cancel Anytime

One Dollar Trial
  • Get FULL ACCESS to all our Excel & Office courses, bonuses, and support for just USD $1 today! Enjoy 30 days of learning and expert help.
  • You can CANCEL ANYTIME — no strings attached! Even if it’s on day 29, you won’t be charged again.
  • You'll get to keep all our downloadable Excel E-Books, Workbooks, Templates, and Cheat Sheets - yours to enjoy FOREVER!
  • Practice Workbooks
  • Certificates of Completion
  • 5 Amazing Bonuses
Satisfaction Guaranteed
Accepted paymend methods
Secure checkout

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!

Share to...