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.
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.
- For more Data Connections and Transformations >> Click Here!
How to Get Data from Text Files to Power BI
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. When you select the More option, the Get Data window will show. You can use this window to select your desired Data source. For this example, you can select the Text/CSV Option and click the Connect button.
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.
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. Please wait until the connection is established.
You can now see the preview of the data in the text file. 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.
When you click the Edit button, the following window opens. Use this window to change the data as per your requirements.
Currently, we don’t want to make any changes to the data. So, let me click the Load button to 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 to the Column Chart in the Power BI article to understand the steps involved in creating it.