About this lesson
We will begin our journey by pulling some sales data into Power BI from a text file, as well as making some minor manipulations to the data.
Download this lesson’s related exercise files. You can download the source data files from the top of your Lessons page.GoSkills Power BI Source Data.zip
443.6 KB Getting Data From a Text file - Completed.pbix
Getting data from a Text file
Using Power BI to import data from a text (or CSV) file.
When to use
Use when you can’t connect directly to a database, but can download your source data to a text (or CSV) file.
The general process is:
- Go to Power BI Desktop
- Get Data --> Text/CSV
- Locate the file and choose Edit when prompted
- Use Remove Rows --> Remove Top Rows to remove any unnecessary rows from the top
- Click “Use First Row as Headers” to promote the first row to headers
- Right click a column --> Remove to remove unnecessary columns
- Click the icons at the top of a column to change data types
- Right click a column --> Remove Errors to remove all rows with errors
- Click the Filter arrow at the top of a column to filter out values and blank rows
- Rename columns by double clicking them (or right click and choose rename)
- Rename your table on the right side
- Click Close & Apply to complete the query
Hints & tips
- Select multiple columns by holding down the CTRL or SHFT key while clicking them
- To set data types on multiple columns, select them, right click one and choose Change Type
- Always remove errors from a column before filtering!
- All steps are recorded on the right side so you can step through them
- Click the gear icon on any step to reconfigure it
Lesson notes are only available for subscribers.