Get Data from Text File to Power BI

In this study, we show you how to connect Power BI to Text Files and get data from text files to Power BI. To demonstrate the Get Data from Text File to Power BI, we will load data from a text file to Power BI and generate a column chart.

How to Get Data from Text Files to Power BI

Before we start getting Data from the Text File to Power BI, Let us see the data present in the Employee Text File.

From the below screenshot, you can see that it is just a normal text file. If you observe closely, the First row has the Column names.

Get Data from Text File to Power BI 1

If you haven’t started the Power BI Desktop yet, Double click on the Power BI desktop to open it. Once it is open, it looks like the screenshot below. Please click on the Get Data hyperlink.

Connect Power BI to Text FIle 1

If you are on the Power BI visualization page, click the Get Data option under the Home tab and select the Text/CSV, as shown below. Or select More options.

Get Data from Text File to Power BI 2

Get Data from Text File to Power BI

When you select the More option, the following window will show. You can use this window to select your desired Data source. For now, let me select the Text/CSV Option and click the Connect button.

Get Data from Text File to Power BI 3

Once you click the Connect button, a new window opens to select the Text File from our file system. For now, we are selecting the Employee.txt file, as shown below.

Get Data from Text File to Power BI 4

Please wait until the connection is established.

Get Data from Text File to Power BI 5

You can now see the preview of the data in the text file.

Get Data from Text File to Power BI 6

Most of the time, Power BI automatically picks the delimiter and separates the columns. If this is not the case, use the Delimiter option to change as per your requirement.

If you are satisfied with the Data and the data types, click the Load button; otherwise, click the Edit button to make changes.

Get Data from Text File to Power BI 7

When you click the Edit button, the following window opens. Use this window to change the data as per your requirements.

Get Data from Text File to Power BI 8

Currently, we don’t want to make any changes to the data. So, let me click on the Load button.

Get Data from Text File to Power BI 9

Now you can see all the Columns imported from the text file under the Fields section.

Get Data from Text File to Power BI 10

Let me create a Column chart using this data. I suggest you refer to the Column Chart in the Power BI article to understand the steps involved in creating it.

Get Data from Text File to Power BI 11