Introduction

The first step when creating a Power BI report is to connect with data sources. Power BI can connect to a wide range of data sources. This capability allows users to access and analyze data from various sources within Power BI. One important format to often deal with is XML. With the import mode, the data is loaded into Power BI. In this tutorial, we want to import Data from a XML file into Power BI. This can be easily done in the Power BI Desktop interface.

Data Source

Our data source is the XML file "student". The file contains the following data:

<students>
    <student>
        <studentid>1</studentid>
        <name>Mike</name>
        <birthdate>2003-05-20</birthdate>
        <birthyear>2003</birthyear>
        <gender>male</gender>
        <creditpoints>50</creditpoints>
    </student>
    <student>
        <studentid>2</studentid>
        <name>Eliza</name>
        <birthdate>2002-01-01</birthdate>
        <birthyear>2002</birthyear>
        <gender>male</gender>
        <creditpoints>40</creditpoints>
    </student>
    <student>
        <studentid>3</studentid>
        <name>Lara</name>
        <birthdate>2002-08-05</birthdate>
        <birthyear>2002</birthyear>
        <gender>female</gender>
        <creditpoints>80</creditpoints>
    </student>
    <student>
        <studentid>4</studentid>
        <name>Jackie</name>
        <birthdate>2003-05-23</birthdate>
        <birthyear>2003</birthyear>
        <gender>female</gender>
        <creditpoints>90</creditpoints>
    </student>
    <student>
        <studentid>5</studentid>
        <name>Travis</name>
        <birthdate>2001-12-19</birthdate>
        <birthyear>2001</birthyear>
        <gender>male</gender>
        <creditpoints>75</creditpoints>
    </student>
    <student>
        <studentid>6</studentid>
        <name>Caleb</name>
        <birthdate>2000-03-02</birthdate>
        <birthyear>2000</birthyear>
        <gender>male</gender>
        <creditpoints>60</creditpoints>
    </student>
    <student>
        <studentid>7</studentid>
        <name>Ava</name>
        <birthdate>2000-07-26</birthdate>
        <birthyear>2000</birthyear>
        <gender>female</gender>
        <creditpoints>100</creditpoints>
    </student>
    <student>
        <studentid>8</studentid>
        <name>Nathan</name>
        <birthdate>2002-11-20</birthdate>
        <birthyear>2002</birthyear>
        <gender>male</gender>
        <creditpoints>45</creditpoints>
    </student>
    <student>
        <studentid>9</studentid>
        <name>Cooper</name>
        <birthdate>2001-06-08</birthdate>
        <birthyear>2001</birthyear>
        <gender>male</gender>
        <creditpoints>95</creditpoints>
    </student>
    <student>
        <studentid>10</studentid>
        <name>Murphy</name>
        <birthdate>2003-12-01</birthdate>
        <birthyear>2003</birthyear>
        <gender>female</gender>
        <creditpoints>70</creditpoints>
    </student>
</students>

Power BI Desktop

In the following, we explain step by step how to import the data into Power BI Desktop.

Open Power BI Desktop

First, we open Power BI Desktop:

Get Data

You can view this post with the tier: Academy Membership

Join academy now to read the post and get access to the full library of premium posts for academy members only.

Join Academy Already have an account? Sign In