Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
โ† Introduction to Power BI ยท Lesson 4 of 9

Module Three

๐Ÿ“– Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
4
Module 3: Connecting and Importing Data in Power BI

Module 3: Connecting and Importing Data in Power BI

3.1 Introduction

Welcome to Module 3!

In the previous module, you learned how to open Power BI Desktop, understand its interface, and save your first Power BI file.

Now, imagine you are a teacher in a secondary school in Ibadan. You have an Excel file containing the names, ages, classes, and examination scores of 100 students.

You want to use Power BI to create charts showing the students' performance. But how will you move the information from Excel into Power BI?

You need to connect to a data source and import the data.

In this module, you will learn how to bring information from Excel files, CSV files, and databases into Power BI.

What you will learn:
  • What a data source is.
  • Different types of data sources.
  • How to import data from Excel.
  • How to import data from CSV files.
  • How to connect to databases.
  • The difference between Import and DirectQuery.
  • How to preview and load data.

3.2 What Is a Data Source?

A data source is the place where information is stored or collected.

Think about your school. Your teacher may keep students' names and examination scores in an Excel spreadsheet. That Excel file is a data source.

A supermarket may store information about its products and customers in a database. That database is also a data source.

Power BI can connect to different data sources and use the information to create reports.

Examples of Data Sources

  • Microsoft Excel: Stores information in worksheets and tables.
  • CSV Files: Stores information as text separated by commas or other delimiters.
  • Databases: Store large amounts of organised information.
  • Websites: Some websites provide data that Power BI can connect to.
  • Cloud Services: Online platforms that store information.

3.3 Understanding Microsoft Excel Data

Microsoft Excel is one of the most common sources of data used in Power BI.

Excel allows people to organise information using rows, columns, and worksheets.

Imagine a school keeps the following student records in Excel:

Student Name Class Subject Score
DavidJSS 2Mathematics85
MaryJSS 2Mathematics92
JohnJSS 2Mathematics70
SarahJSS 2Mathematics78

Power BI can read this information and help the teacher create a report showing the students' scores.

3.4 How to Import Data from Microsoft Excel

Let's learn how to connect an Excel file to Power BI Desktop.

Step-by-Step Instructions

  1. Open Power BI Desktop.
  2. Go to the Home tab.
  3. Click Get Data.
  4. Select Excel Workbook.
  5. Find the Excel file you want to use on your computer.
  6. Select the file and click Open.
  7. Power BI will display a Navigator window.
  8. Select the worksheet or table you want to import.
  9. Click Load to bring the data into Power BI.

After loading, the information will appear in the Data pane and can be used to create visualisations.

Important: If your Excel file contains several worksheets, check the Navigator window carefully. Select the correct worksheet or table before loading it.

3.5 What Is a CSV File?

CSV means Comma-Separated Values.

A CSV file is a simple file format used to store information in rows and columns. Each value is usually separated by a comma.

For example, imagine a CSV file containing student information:

Student Name,Class,Subject,Score
David,JSS 2,Mathematics,85
Mary,JSS 2,Mathematics,92
John,JSS 2,Mathematics,70
Sarah,JSS 2,Mathematics,78

Each line represents a record, while commas separate the individual values.

CSV files are useful because many applications can create and read them.

How to Import a CSV File into Power BI

  1. Open Power BI Desktop.
  2. Click the Home tab.
  3. Select Get Data.
  4. Choose Text/CSV.
  5. Locate your CSV file.
  6. Select the file and click Open.
  7. Power BI will show a preview of the information.
  8. Check that the columns and values look correct.
  9. Click Load to import the data.

Your CSV information is now available for analysis in Power BI.

3.6 Connecting to Databases

A database is a system used to store and organise information so that it can be accessed, managed, and updated.

Imagine a large bank has millions of customer records. It would be difficult to manage all that information using ordinary paper documents.

The bank can use a database to store information such as:

  • Customer names.
  • Account numbers.
  • Transaction records.
  • Account balances.
  • Transaction dates.

Power BI can connect to supported databases and use their information to create reports.

Examples of Databases Power BI Can Connect To

  • Microsoft SQL Server.
  • MySQL.
  • PostgreSQL.
  • Oracle Database.
  • Microsoft Access.
  • Azure SQL Database.

Some database connections may require additional drivers, permissions, network access, or configuration.

Basic Steps for Connecting to a Database

  1. Open Power BI Desktop.
  2. Click Get Data.
  3. Select the database connector you want to use, such as SQL Server.
  4. Enter the required server and database details.
  5. Choose the appropriate connection mode if available.
  6. Provide login details if requested.
  7. Select the tables or data you need.
  8. Preview the information.
  9. Click Load or Transform Data.
Safety tip: Never share database passwords or confidential business information with people who are not authorised to access them.

3.7 Understanding Import and DirectQuery Modes

When connecting to some data sources, Power BI allows you to choose how it accesses the information.

Two important connection modes are Import and DirectQuery.

1. Import Mode

Import mode copies selected data into the Power BI model.

Imagine you have an Excel file containing the sales records of a supermarket. When you import the information, Power BI loads a copy of the selected data into its model.

Power BI can then analyse the imported information without requesting every value from the original source each time you interact with a report.

When the original data changes, you normally need to refresh the Power BI data to bring in the updates.

2. DirectQuery Mode

DirectQuery allows Power BI to query the original data source when users interact with reports, rather than importing all the data into the Power BI model.

For example, a company may keep its sales records in a database. With DirectQuery, Power BI sends queries to that database to retrieve the information needed for a visual.

The results depend on the database, network connection, and the way the report is designed.

Difference Between Import and DirectQuery

Import Mode DirectQuery Mode
Loads a copy of selected data into the Power BI model. Queries the original data source when needed.
Usually provides fast report interactions after data is loaded. Performance depends partly on the source system and connection.
Needs refreshing to bring in later changes from the source. Can retrieve updated source information when queries run.
Uses storage in the Power BI model. Keeps the main data in the original source.

Simple example: Import is like bringing a copy of your class register into your notebook. DirectQuery is like checking the official class register whenever you need information.

3.8 Previewing Data Before Loading

Before importing information into Power BI, it is important to check whether the data looks correct.

This is called previewing data.

Imagine you are importing a supermarket sales file. You should check that:

  • Product names are visible.
  • Prices are displayed correctly.
  • Sales quantities are not missing.
  • Dates are recognised correctly.
  • Columns have the correct headings.

Previewing helps you discover problems before using the information to create reports.

What Should You Look For?

Problem Example
Missing valueA student has no examination score.
Wrong data typeA sales amount is treated as text.
Incorrect headingA column is named Column1 instead of Product.
Unwanted recordsA blank row appears in the file.

Some problems can be corrected in Power Query before the data is loaded.

3.9 Loading Data into Power BI

After selecting a data source and checking its information, the next step is loading the data.

Loading data means bringing the selected information into your Power BI model so that you can use it in reports and visualisations.

Steps to Load Data

  1. Open Power BI Desktop.
  2. Click Get Data.
  3. Select your data source.
  4. Choose the file, table, or information you need.
  5. Check the preview.
  6. Click Load.
  7. Wait for Power BI to finish loading the information.
  8. Check the Data pane for the imported table.

You can now use the imported fields to create charts and reports.

3.10 Practical Project: Import Student Examination Results

Project: Create Your First Student Data Table

Imagine you are helping a teacher in a secondary school in Ibadan. The teacher wants to analyse the examination results of five students.

First, create a small table in Microsoft Excel using the following information:

Student Class Subject Score
DavidJSS 2Mathematics85
MaryJSS 2Mathematics92
JohnJSS 2Mathematics70
SarahJSS 2Mathematics78
PeterJSS 2Mathematics88

Your tasks:

  1. Open Microsoft Excel.
  2. Enter the student information into a worksheet.
  3. Save the file as Student Results.xlsx.
  4. Open Power BI Desktop.
  5. Click Get Data and select Excel Workbook.
  6. Choose Student Results.xlsx.
  7. Select the worksheet containing the student records.
  8. Preview the information.
  9. Click Load.
  10. Confirm that the student table appears in the Data pane.

Challenge: Can you identify the student with the highest examination score without using a calculator?

3.11 Important Terms to Remember

Term Simple Meaning
Data SourceA place where information is stored or collected.
Excel WorkbookAn Excel file containing worksheets and information.
CSVA file format that stores values separated by commas or other delimiters.
DatabaseA system for storing and organising information.
Import ModeA connection mode that loads a copy of selected data into Power BI.
DirectQueryA mode that queries the original data source when needed.
Data PreviewChecking information before loading it.
LoadBringing selected data into the Power BI model.

3.12 Knowledge Check

Choose the correct answer for each question.

  1. What is a data source?
    A. A computer game
    B. A place where information is stored or collected
    C. A keyboard
    D. A music player
  2. Which of these is a common data source for Power BI?
    A. Microsoft Excel
    B. A television remote
    C. A speaker
    D. A computer mouse
  3. What does CSV stand for?
    A. Computer System Value
    B. Central Storage Version
    C. Comma-Separated Values
    D. Common Software View
  4. Which option do you use to connect Power BI to an Excel file?
    A. Insert Picture
    B. Get Data
    C. Save As
    D. Print
  5. What does a database do?
    A. Plays music
    B. Creates animations
    C. Stores and organises information
    D. Prints photographs
  6. What happens in Import mode?
    A. A copy of selected data is loaded into the Power BI model
    B. The computer shuts down
    C. All data is deleted
    D. The report is automatically printed
  7. What does DirectQuery do?
    A. Deletes the original database
    B. Queries the original data source when needed
    C. Changes the computer password
    D. Creates a video
  8. Why should you preview data before loading it?
    A. To change the computer wallpaper
    B. To delete Power BI
    C. To play a game
    D. To check that the information looks correct
  9. Which of these is a database system?
    A. Microsoft SQL Server
    B. Microsoft Paint
    C. Windows Calculator
    D. Notepad
  10. What does loading data into Power BI mean?
    A. Closing the application
    B. Deleting the Excel file
    C. Bringing selected information into the Power BI model
    D. Turning off the computer

Module 3 Summary

In this module, you learned how to connect Power BI to different data sources. You discovered how to import information from Microsoft Excel and CSV files, and how Power BI connects to databases.

You also learned the difference between Import and DirectQuery modes, how to preview information, and how to load data into Power BI.

Remember, before creating a report, you need information to work with. Connecting to a data source is one of the first steps in data analysis.

Coming Up in Module 4

Cleaning and Preparing Data with Power Query: You will learn how to remove duplicate records, handle missing values, correct data types, rename columns, split information, and prepare your data for accurate analysis.

๐Ÿ† Get Certified

๐Ÿ”’

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (โ‚ฆ2,000 or 20,000 coins), and get a verified certificate with your name on it.

๐ŸŽ“ Sign Up to Get Certified
๐Ÿ› ๏ธ Practice Tools
Hands-on simulators & labs - subscription required.
โ†’
๐ŸŽฏ Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
โ†’