Excel Power Query
Introduction
Microsoft Excel Power Query is a built-in tool that lets you import, clean, and reshape data automatically. Using Microsoft Excel Power Query with an API fundamentally changes the workflow from manual extraction to automated data pipelines.
Key advantages:
- Automation and refreshability: Instead of repeatedly downloading CSVs from your CRM, Power Query can call the API directly. Data updates become a one-click refresh (or scheduled), eliminating repetitive manual effort.
- Consistency and reduced human error: Manual downloads + pivot tables often lead to version drift and mistakes (e.g. wrong filters, broken formulas). Power Query applies the same transformation steps every time, producing reproducible outputs.
- Scalability: Large datasets that would be cumbersome in manual Excel workflows (multiple files, many pivots) can be handled more efficiently through query logic and incremental loading.
- Centralised data logic: Instead of “endless pivot tables” scattered across workbooks, transformation logic is defined once in Power Query. Reporting layers (pivots, dashboards) then sit cleanly on top of a controlled dataset.
- Near real-time reporting: With API access, you can monitor activity much closer to real time, rather than relying on periodic exports.
In practice, this means you spend less time preparing data and more time interpreting it, while benefiting from more timely and reliable reporting.
In order to fully understand how the API can work with tools like Power Query, the following video will explain some of the basic concepts first.
What you will need
In order to follow this section you will need the following;
- Dizions API (Read Only or Read/Write)
- Microsoft Excel 2016 or later
- API Development tool (Optional)
Getting Started
Here we are going to look at how to get started using the API and Excel Power Query. Before you start you will need to create an Authentication File, with this file we can then use a standard header for all of our queries that we wish to use.
Open Microsoft Excel either using an existing file or a new blank workbook. The examples below will be using a blank workbook. You will need the data tab available in Excel.
Click on the data tab and select 'Get Data' on the left hand side. Select From other Sources>Blank Query
This will open the Power Query Editor and create Query 1. We are going to use the advanced editor to paste the following:
- Details of the authentication, stored in our Authentication File.
- A call to the API dictionary to see which records we have on the system.
To access the Advanced editor click on the View Tab and select 'Advanced Editor'. This will open a new window. For the purpose of this example you can copy the text below but you will need to change the file path on the second line (keyFile) to the location of your Authentication File. In the advanced editor delete the details currently displayed and paste the example below from the text file, making sure you have updated the keyFile line..
You will be prompted that Information is required for the data privacy.
- Click on continue.
- Click the check box to ignore privacy and select save.
The query will then run and display a list of the record types available in your system. This can be used as an index to lookup ID's for the records you may wish to use. On the right hand side you can change the name of the query, like 'List of Record types'.
From here we can click on close and load. If you haven't set the privacy above to will be prompted to do so. The data that is received from the API will then be added to a new worksheet in a table. If we wish to edit the query we can right click on the query in the 'Queries and Connections panel". If you have minimised the panel in can be found on the Data tab of the ribbon.
The next steps from here is to add further queries to your workbook.
Moving forward
In this section you will find examples of queries to help you move forward. Each query will need to be added to the header information as explain earlier.
This example text file below will, making sure you have updated the keyFile line.:
- Retrieve records from type 1 (the default client record of the system)
- The fields retrieved will be the Record ID, Surname, Forenames and ethnicity.
- The query will convert to a table and expand the fields to include the fields above.
This example text file below will, making sure you have updated the keyFile line.:
- Retrieve referrals from all projects form 01/01/2020 to 31/12.2020
- The fields retrieved will be the Referral/Case ID, the date, contact method, client age range at time of referral and the name of the project..
- The query will convert to a table and expand the fields to include the fields above.
You can download the below XLSX file that has three queries;
- Record Types
- All Referrals in 2020
- Record Type 1 (Default Client Record)
Once opened you will need to edit each query to specify the location of your Authentication File. This is done by editing the keyFile line.


