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
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
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
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
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.
Please wait until the connection established
Now you can see the preview of the data present in the text file.
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.
When you click the Edit button, the following window opened. Use this window to change the data as per your requirement.
Currently, we don’t want to make any changes to the data. So, let me click on the Load button
Now you can see all the Columns imported from the text file under the Fields section.
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.