How to load Text or CSV files into Power BI


This paper lays out the process for getting text and CSV file data into Power BI. It gives you two options, step by step: you can either load the data directly or transform it using the Power Query Editor. 
The whole point of this guide is to make the import process simple to understand and help you decide the best approach for prepping your data.
Power BI Data Import Process map
This is how you get your text or CSV file data into Power BI, step by step.

 

1. Get Data

  •  Action: On the Home tab in Power BI Desktop, click the "Get Data" button.
  • Selection: From the list of data sources, select "Text/CSV".

Import data from a text or CSV file from Home menu




2. Select File



  • Action: A file explorer window will open.
  • Selection: Navigate to the directory containing the desired .csv file.

select CSV file from your folders



3. Preview and Settings


  • Action: A CSV connection preview window appears, displaying a sample of the data from the .csv file.
  • Verification: Review the settings in the preview window to ensure they are appropriate for your data. Key settings include:
    • Delimiter: The character used to separate columns in the .csv file (e.g., comma, semicolon, tab).
    • Data Type Detection: How Power BI automatically detects the data type of each column (e.g., based on first 200 rows, based on entire dataset, or do not detect).
  • Modification (If Necessary): If the default settings are incorrect, adjust them to match the structure of your .csv file. For example, if your file uses a semicolon as a delimiter, change the delimiter setting accordingly.
  • Decision Point: After verifying and adjusting the settings, you have two options: Load the data directly or transform the data using the Power Query Editor.


You can see preview in your data and you can click "load" button





 4. Transform Data


  • Condition: Select this option if the data requires pre-processing before it can be used effectively in Power BI. This may include tasks such as:
    • Changing data types (e.g., converting text to numbers or dates).
    • Removing unnecessary columns.
    • Filtering rows based on specific criteria.
    • Replacing missing values.
    • Splitting columns into multiple columns.
    • Merging columns.

  • Action: Click the "Transform Data" button.
  • Outcome: This action opens the Power Query Editor, a powerful tool for data cleaning and transformation.

  



5. Power Query Editor (Optional)



  • Environment: The Power Query Editor provides a graphical interface for performing a wide range of data cleaning and transformation tasks.
  • Data Cleaning Tasks: Use the various tools and functions available in the Power Query Editor to perform the necessary data cleaning tasks. This may involve:

    • Changing Data Types: Use the "Data Type" menu to change the data type of a column.
    • Removing Columns: Select the column(s) you want to remove and click "Remove Columns".
    • Filtering Rows: Use the "Filter" menu to filter rows based on specific criteria.
    • Replacing Values: Use the "Replace Values" function to replace specific values in a column.
    • Splitting Columns: Use the "Split Column" function to split a column into multiple columns based on a delimiter or other criteria.
    • Merging Columns: Use the "Merge Columns" function to merge multiple columns into a single column.


  • Close & Apply: Once you have completed all the necessary data cleaning tasks, click the "Close & Apply" button in the Power Query Editor.
  • Outcome: The Power Query Editor applies the transformations you have defined and loads the final, transformed data into the Power BI Data Model. The data is now ready for use in creating visualizations and reports.



Warpping up


This flow diagram provides a clear and concise overview of the process of importing data from a Text/CSV file into Power BI. By following these steps, users can effectively load and prepare their data for analysis and visualization.




<Other posts on the blog>


The Hidden Hero of Data Analysis: The Mode (Part 3) Mode-Based Customer Behavior Analysis (Ice Cream Sales Dataset Practical Analysis)

Comments

Popular posts from this blog

DAX CALENDAR Function Deep Dive and Practical Usage Guide

Standard Deviation The Complete Guide to the Core of Business Data Analysis