March 22, 2020   Finance /

Power BI: Xero Connector for P&L

Xero is an online accounting tool for small businesses. I have been working with it for the past few months and the richness of its features, along with its simplicity is impressive.

You can check it out at www.xero.com.

In this post, I will show you how to connect Xero to Power BI Desktop using a custom connector. 

I created a Xero connector that allows you to retrieve your YTD P&L for the current and previous year, and then analyze it in Power BI. You can download the custom connector plus a sample dashboard for free at the bottom of this blog post.

The connector leverages the Xero API. API stands for 'Application Program Interface' and it is the standard way to access Xero data from an external application.

As I am not a Xero App Partner yet, this connector is limited to the first 25 organizations that will use it. I hope that I will be able to lift this limit soon.

If the connector does not work for you, meaning that the 25 organization limit is reached, or you need more data from Xero (bank transactions, customer invoices, bills, balance sheet, project profitability, etc), you can contact me at lc@finance-bi.com

How does it work?

The custom connector acts as the link between Xero API and Power BI. 

When you open Power BI and choose to get data from the Xero Connector, a pop-up will ask you to log in to Xero. Xero will then approve your credentials and send the information to Power BI. 

The custom connector will interpret the information received from Xero and transform it into a table, ready to be used by Power BI.

Does this connector save a copy of my data somewhere?

No, the connector simply acts as the 'interpreter' between Xero API and Power BI. 

How to set-up Xero P&L Connector for Power BI?

First, download the zip file at the bottom of the post. The zip file contains 
– the connector 'Xero PL Connector – Finance BI.mez'
– a sample Power BI report 'Xero PL Connector.pbix'

Copy the connector file and paste it to 'Documents/Power BI Desktop/Custom Connectors'. If this is your first time using a custom connector, the folders 'Power BI Desktop' and 'Custom Connectors' will not exist. Thus you will need to create them.

Create a folder in Power BI for the Xero custom connector

The next step is to activate Power BI permissions for custom connectors. Go to File -> Options and Settings -> Options -> Security -> Data Extensions. Check 'Allow any extensions to load without validation or warning'.

You can read more about allowing custom connectors here.

Allow Custom Connectors in Power BI

You are now ready to get your data! 

In the Power BI toolbar click on Get Data -> More. Type 'Xero PL Connector' in the search box that appears. Then select it and click Connect.

Get Data from Xero P&L Connector

A window will prompt you to sign-in. Click on Sign In, then follow the instructions from Xero.

Authorize Xero Connector

Once you authorize the connector, you can click on Connect.

Connect to Xero

Finally, a navigator window will pop-up with your company name. You can select it and click Load. 

Load Xero data to Power BI

That's it, you now access to your Xero data in Power BI!

As mentioned above, this connector is limited to the YTD P&L of the current and previous year. If you need access to more data, send me an email to lc@finance-bi.com.

Bonus: Power BI report to analyze Xero P&L

As a bonus, the zip file includes a pre-made Power BI report to visualize your data right away. You don't need this report to start analyzing your data.

Below is what the report looks like.

Bonus Report for Xero P&L Analysis

Below are the steps to link this report with your connector.

Click on 'Transform Data' in the toolbar. This will open Power Query. On the left, you will see a Query with the name of your company. Click on it, then click on 'Advanced Editor'. 

If you don't see it, you can follow the steps above to create the Query (from Get Data -> More).

Copy the Connector code from Advanced Editor

A window will pop-up with code for the connector. Select everything, then copy it (Ctrl+C) and finally click Cancel to exit.

Copy the Connector code from Advanced Editor

Now open the 'Xero PL Connector.pbix' file that you extracted from the zip.  Click on 'Transform Data' to go to Power Query.

On the left, you will a Query called 'Xero Connector – Profit & Loss'. Select it, then open the Advanced Editor. Delete all the code, and paste the code that you copied before. Click on Done.

Now you can choose 'Close & Apply'. This will take you back to Power BI and the report will show your numbers!

Enjoyed the article? Subscribe to the newsletter and download the Power BI and connector for free.

    Share this post

    AUTHORLuca
    I help SMEs who want to get a clear view on what drives their profit. After becoming a CPA and 10 years in Corporate Finance between the US, Europe, and Asia I discovered my real passion. I love helping Small and Medium Companies figure out how to improve their profit and be sustainable.

    Join the discussion

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    LN Consulting
    Tired Of Building A Dashboard By Yourself?

    Continue Reading...

    May 2, 2022
    In this post, I will teach you how to track new and repeat customers in Power BI. While new customers are key to a company’s growth, the cost of acquiring them is usually higher compared to repeat customers. It is therefore important to have a balanced growth between new and repeat customers. Below is the ...
    Read More
    May 2, 2022
    In this article, you will learn how to run your Cohort Analysis in Power BI.  The cohort analysis is a powerful customer analysis: it segments customers based on when they first purchased a product. Specifically, it answers the questions: Are newer customers coming back more often than older customers? Are newer customers spending more than ...
    Read More
    May 2, 2022
    In this post, I will teach you how to build a Pareto analysis dashboard in Power BI. Specifically, the Pareto principle states that 20% of the causes generate 80% of the effects, and vice-versa. We can apply this empirical principle to different topics, from work (20% of the efforts cause 80% of the results) to ...
    Read More