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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Ben_Ges
New Member

XML import only imports first line

Hi,

 

I am trying to import a .xml into Power Query in Excel. The file has the following structure:

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="retainvarsexport.xsl"?>
<Recipe Version="1.0">
<Header>
<Type>retainvarsexport</Type>
<Name></Name>
<Count>18095</Count>
<Modified>2021-07-20T10:59:00</Modified>
<ProjectName>Project 1</ProjectName>
<ProjectVersion>3.x.55.0</ProjectVersion>
<GeneratorName>Epam4</GeneratorName>
<GeneratorVersion>1.2.0.10733</GeneratorVersion>
</Header>
<Body>
<Variable Name="Variable 1" Type="BYTE">0</Variable>
<Variable Name="Variable 2" Type="BYTE">0</Variable>
<Variable Name="Variable 3" Type="BOOL">0</Variable>
<Variable Name="Variable 4" Type="BYTE">0</Variable>
<Variable Name="Variable 5" Type="REAL">0</Variable

<Variable Name="Variable 6" Type="BOOL">0</Variable>
</Body>
</Recipe>

 

When I import the file into Power Query, I only get the following:

Ben_Ges_0-1629448798205.pngBen_Ges_1-1629448831875.png

 

Unfortunately I am not able to import the variables. 

 

When I change the code to this:

<Body>
<Variable Name="Variable 1" Type="BYTE">0</Variable>
<Variable Name="Variable 2" Type="BYTE">0</Variable>
<Variable Name="Variable 3" Type="BOOL">0</Variable>
<Variable Name="Variable 4" Type="BYTE">0</Variable>
<Variable Name="Variable 5" Type="REAL">0</Variable

<Variable Name="Variable 6" Type="BOOL">0</Variable>
</Body>

 

I am able to import the data in the way I want:

Ben_Ges_2-1629449034406.pngBen_Ges_3-1629449052459.png

 

It works, but I need to change the code in the .xml. 

Is there a way to import the data without modifying the code?

 

I look forward to suggestions. 

And sorry if this question seems foolish, I am totally new to Power Query... 😄 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

In your first pic, just click on the word Table in the Body column to drill to your variables.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
mahoneypat
Microsoft Employee
Microsoft Employee

In your first pic, just click on the word Table in the Body column to drill to your variables.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi Pat,

 

I have a similar problem. But I would like to import all tables (not only variables of one column). My xml file is structured hierarchical containing lots of tables. 

 

Is there a simple way to import all tables?

 

Best regards, Jacob

Hi, did you solve this? Can you share how?

@mahoneypat, it worked. Thank you. 🙂 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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