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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pwares
Frequent Visitor

Unable to Import EIA Data - Bulk Data File - Petroleum

Hi There,

 

I'm interested in importing Petroleum Data from the EIA. https://www.eia.gov/opendata/bulkfiles.php

from here I downloaded the petroleum data: http://api.eia.gov/bulk/PET.zip

 

The format of the file is a text file that I downloaded from this website (originally a zip file that I extracted). When I attempted to load this text file into Power BI desktop, unfortunately Power BI was unable to recognize the file. I tried various delimiters to get Power BI to recognize the file format. However, I was unable to reach an effective solution.

 

According to EIA's website: . The extracted text file contains all the dataset's series (ordered by most recent update data first) followed by all of the dataset's categories (ordered by hierarchy from top to bottom). Each line of the extracted text file is a complete object in JSON.

 

Could I please get some help one which keystrokes are required to view this data effectively in Power BI?

 

Thanks a lot

Peter

 

 

1 ACCEPTED SOLUTION

Thanks for your response, unfortunately I received errors when trying your method:

 

Specifically, the Power BI error mentioned: Unable to connect, we encountered an error while trying to connect, Details: "We found extra errors at the end of JSON input"

 

As a result, I searched this forum for a similar error message, and came across this tip: 

 

 

BNajlis
New Member
Re: We found extra characters at the end of JSON input.

 

Found the same issue when trying to load a JSONL file (http://jsonlines.org/). To solve it, I ended up importing it as a text file (which takes one record per line) and then using the Parse function in PowerQuery to parse the JSON in each line.

 

 

Eventually I was able to get a successful result by using the Parse Function

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

Hey @pwares ,

 

this is how the data looks like

TomMartens_0-1603250823420.png

To achieve this I did the following after extracting the txt file from the zip archive

Connect to a JSON file

image.png

I just changed the file type to All files (*.*)

image.png

I choose the PET.txt file
image.png

 

Voila, hopefully this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thanks for your response, unfortunately I received errors when trying your method:

 

Specifically, the Power BI error mentioned: Unable to connect, we encountered an error while trying to connect, Details: "We found extra errors at the end of JSON input"

 

As a result, I searched this forum for a similar error message, and came across this tip: 

 

 

BNajlis
New Member
Re: We found extra characters at the end of JSON input.

 

Found the same issue when trying to load a JSONL file (http://jsonlines.org/). To solve it, I ended up importing it as a text file (which takes one record per line) and then using the Parse function in PowerQuery to parse the JSON in each line.

 

 

Eventually I was able to get a successful result by using the Parse Function

Hi @pwares ,

 

Could text connectors meet your needs?

V-lianl-msft_0-1603420798981.png

You could split columns or expand columns as you like in transform data.

V-lianl-msft_1-1603420984472.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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