# Loading Data Files in Excel

{% hint style="info" %}
The instructions on this page are based on Excel 2019.
{% endhint %}

## Supported Formats

Excel 2013 (or later) on Windows can load compressed CSV (`csv.gz`) data files through Power Query into a Power Pivot (also known as the Excel 'Data Model').&#x20;

All versions of Excel can load uncompressed CSV data files without using Power Query, but this is not recommended for large data files.

{% hint style="danger" %}
We only recommend using Excel with the large data files if you intend to use Power Query to load the data directly into [Power Pivot](https://support.microsoft.com/en-us/office/get-started-with-power-pivot-in-microsoft-excel-fdfcf944-7876-424a-8437-1a6c1043a80b), which is designed to handle millions of rows. Once loaded into Power Pivot, the data can be analysed using PivotTables and PivotCharts.
{% endhint %}

## Download the Data Files

Download and save the data files to a suitable location. In the examples that follow, the data has been saved to `C:\data`.&#x20;

{% hint style="info" %}
Although you could load data files directly from the data file URLs, this is not recommended because you may quickly hit usage limits or incur additional costs. We always recommend saving the files locally or to cloud storage first using the Open Data Blend Dataset UI, Open Data Blend Dataset API, or [Open Data Blend for Python](https://github.com/opendatablend/opendatablend-py).
{% endhint %}

## Loading Compressed (Gzip) CSV Data Files

You can use the below steps as a guide on how you can load compressed (Gzip) data files in Excel.

Navigate to the 'Data' tab in the Excel ribbon and click `Get Data > From Other Sources > Blank Query` to create a new blank query.

![](/files/-MUFse8k_nCvHntk9rp_)

Use the Advanced Editor to add a Power Query M expression like the following to the blank query. This will allow the compressed (Gzip) data file to be loaded directly.&#x20;

```bash
let
    Source = Binary.Decompress(File.Contents("C:\data\date\date.csv.gz"), Compression.GZip),
    #"Imported CSV" = Csv.Document(Source,[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.None])
in
    #"Imported CSV"
```

<div align="left"><img src="/files/-MUFtSdhm0cX7_b80CvR" alt=""></div>

{% hint style="info" %}
Note that the Power Query M expression explicitly applies Gzip decompression in the 'Source' step. Without this, Power Query is not able to read the compressed (Gzip) data file directly.
{% endhint %}

Click 'Done' on the Advanced Editor window and a preview of the data should appear.

<div align="left"><img src="/files/-MUFu5aVAEZ_e61WqQX5" alt=""></div>

Apply the 'Use First Row as Header' transformation and rename the query to something appropriate.

<div align="left"><img src="/files/-MUFwJKKzSM9gnfUTIeL" alt=""></div>

Click `Close & Load > Close & Load to...` and ensure that you have 'Only Create Connection' selected and the 'Add this data to the Data Model' checkbox ticked.

<div align="left"><img src="/files/-MUFxAuyowKgSwXd0F5J" alt=""></div>

## Using Excel for Data Analysis

Guidance on how to analyse data in Excel is beyond the scope of this documentation. You may find the following external links helpful:

* [What is Power Query?](https://docs.microsoft.com/en-us/power-query/power-query-what-is-power-query)
* [Get started with Power Pivot in Microsoft Excel](https://support.microsoft.com/en-us/office/get-started-with-power-pivot-in-microsoft-excel-fdfcf944-7876-424a-8437-1a6c1043a80b)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.opendatablend.io/open-data-blend-datasets/loading-data-files-in-excel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
