Get Data from Text File to Power BI

In this study, we show you how to connect Power BI to Text Files, and how to get data from text file 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 File to Power BI

Before we start getting Data from 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. 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 in the Power BI visualization page, under the Home tab, click the Get Data option and select the Text/CSV, as we 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 Connect button

Get Data from Text File to Power BI 3

Once you click on the Connect button, a new window opened 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 established

Get Data from Text File to Power BI 5

Now you can see the preview of the data present in the text file.

Get Data from Text File to Power BI 6

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

If you are satisfied with the Data and the data types, then 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 opened. Use this window to change the data as per your requirement.

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, Column Chart in Power BI article to understand the steps involved in creating it.

Get Data from Text File to Power BI 11