Bird
Raised Fist0
Power BIbi_tool~10 mins

Excel data import in Power BI - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load data from an Excel file in Power BI.

Power BI
let
    Source = Excel.Workbook(File.Contents([1]), null, true)
in
    Source
Drag options to blanks, or click blank then click option'
AFile.Contents
BSalesData.xlsx
CExcel.Workbook
D"C:\\Data\\SalesData.xlsx"
Attempts:
3 left
💡 Hint
Common Mistakes
Using just the file name without path
Not using double backslashes in the file path
Omitting quotes around the file path
2fill in blank
medium

Complete the code to select the first sheet from the Excel workbook.

Power BI
let
    Source = Excel.Workbook(File.Contents("C:\\Data\\SalesData.xlsx"), null, true),
    FirstSheet = Source[1][Data]
in
    FirstSheet
Drag options to blanks, or click blank then click option'
A"Sheet1"
B1
C0
D"Data"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 for the first sheet
Using the sheet name as a string instead of index
Using the wrong field name instead of [Data]
3fill in blank
hard

Fix the error in the code to correctly load the Excel sheet named 'Sales'.

Power BI
let
    Source = Excel.Workbook(File.Contents("C:\\Data\\SalesData.xlsx"), null, true),
    SalesSheet = Table.SelectRows(Source, each [1] = "Sales")[Data]{0}
in
    SalesSheet
Drag options to blanks, or click blank then click option'
ATable
BName
CData
DSheet
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Sheet' instead of 'Name' as the column
Filtering by 'Data' which is the content, not the sheet name
Using 'Table' which is not a column name
4fill in blank
hard

Fill both blanks to filter rows where the 'Region' column equals 'West' and select only the 'Sales' column.

Power BI
let
    Source = Excel.Workbook(File.Contents("C:\\Data\\SalesData.xlsx"), null, true),
    SalesSheet = Table.SelectRows(Source{0}[Data], each [[1]] = [2])
in
    Table.SelectColumns(SalesSheet, {"Sales"})
Drag options to blanks, or click blank then click option'
ARegion
B"West"
C"Sales"
DData
Attempts:
3 left
💡 Hint
Common Mistakes
Using column name without brackets
Not quoting the string value 'West'
Using wrong column names
5fill in blank
hard

Fill all three blanks to load the Excel file, filter the sheet named '2023Data', and select columns 'Product' and 'Revenue'.

Power BI
let
    Source = Excel.Workbook(File.Contents([1]), null, true),
    FilteredSheet = Table.SelectRows(Source, each [[2]] = [3])[Data]{0},
    Result = Table.SelectColumns(FilteredSheet, {"Product", "Revenue"})
in
    Result
Drag options to blanks, or click blank then click option'
A"C:\\Reports\\AnnualReport.xlsx"
BName
C"2023Data"
DData
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes for file path or sheet name
Using wrong column name for filtering
Forgetting to select columns after filtering

Practice

(1/5)
1. What is the main purpose of importing Excel data into Power BI?
easy
A. To analyze and visualize spreadsheet data within Power BI
B. To edit Excel formulas directly in Power BI
C. To convert Excel files into Word documents
D. To send Excel data as email attachments automatically

Solution

  1. Step 1: Understand Power BI's role

    Power BI is designed to analyze and visualize data from various sources, including Excel.
  2. Step 2: Identify Excel data import purpose

    Importing Excel data allows users to bring spreadsheet data into Power BI for creating reports and dashboards.
  3. Final Answer:

    To analyze and visualize spreadsheet data within Power BI -> Option A
  4. Quick Check:

    Excel data import = Analyze and visualize [OK]
Hint: Power BI imports Excel to analyze data visually [OK]
Common Mistakes:
  • Thinking Power BI edits Excel formulas
  • Confusing Excel data import with file conversion
  • Assuming automatic email sending from import
2. Which of the following is the correct way to start importing an Excel file into Power BI?
easy
A. Drag the Excel file into the Power BI report canvas
B. Open Excel and save as CSV before importing
C. Use the 'Export' option in Power BI to import Excel
D. Click 'Get Data' and select 'Excel' from the options

Solution

  1. Step 1: Locate data import feature in Power BI

    Power BI uses the 'Get Data' button to start importing data from various sources.
  2. Step 2: Select Excel as data source

    After clicking 'Get Data', selecting 'Excel' allows you to browse and import Excel files directly.
  3. Final Answer:

    Click 'Get Data' and select 'Excel' from the options -> Option D
  4. Quick Check:

    Import Excel = Get Data > Excel [OK]
Hint: Use 'Get Data' > 'Excel' to import files [OK]
Common Mistakes:
  • Trying to drag files onto report canvas
  • Confusing export with import
  • Thinking CSV conversion is mandatory
3. After importing an Excel file with multiple sheets, what will Power BI show in the Navigator window?
medium
A. A list of all sheets and named ranges to select from
B. Only the first sheet automatically loaded
C. A preview of the entire Excel workbook as one table
D. An error message if multiple sheets exist

Solution

  1. Step 1: Understand Navigator window role

    The Navigator window shows available tables, sheets, or named ranges from the Excel file for selection.
  2. Step 2: Identify what appears for multiple sheets

    Power BI lists all sheets and named ranges so users can choose which data to load.
  3. Final Answer:

    A list of all sheets and named ranges to select from -> Option A
  4. Quick Check:

    Navigator = List sheets and ranges [OK]
Hint: Navigator lists all sheets and ranges for selection [OK]
Common Mistakes:
  • Assuming only first sheet loads automatically
  • Expecting combined preview of all sheets
  • Thinking multiple sheets cause errors
4. You imported an Excel file but see incorrect data types in Power BI. What is the best way to fix this?
medium
A. Edit the Excel file and re-import without changes
B. Ignore data types; Power BI will fix them automatically
C. Use Power Query Editor to change data types before loading
D. Delete the import and start a new Power BI report

Solution

  1. Step 1: Identify issue with data types

    Incorrect data types can cause wrong analysis or errors in reports.
  2. Step 2: Use Power Query Editor for correction

    Power Query Editor allows changing column data types before loading data into Power BI.
  3. Final Answer:

    Use Power Query Editor to change data types before loading -> Option C
  4. Quick Check:

    Fix data types = Power Query Editor [OK]
Hint: Fix data types in Power Query Editor before loading [OK]
Common Mistakes:
  • Assuming Power BI auto-fixes all data types
  • Re-importing without correcting data types
  • Deleting report instead of fixing data
5. You want your Power BI report to update automatically when the Excel file changes. What should you do?
hard
A. Manually re-import the Excel file every time it changes
B. Set up scheduled refresh in Power BI Service connected to the Excel file
C. Save the Excel file as PDF and import the PDF instead
D. Use Excel macros to push data to Power BI

Solution

  1. Step 1: Understand refresh options in Power BI

    Power BI Service can refresh datasets on a schedule to keep reports updated.
  2. Step 2: Connect scheduled refresh to Excel file

    Scheduling refresh ensures Power BI pulls latest data from the Excel file automatically.
  3. Final Answer:

    Set up scheduled refresh in Power BI Service connected to the Excel file -> Option B
  4. Quick Check:

    Auto-update = Scheduled refresh [OK]
Hint: Use scheduled refresh in Power BI Service for updates [OK]
Common Mistakes:
  • Thinking manual re-import is only way
  • Importing PDF instead of Excel
  • Using Excel macros which don't update Power BI automatically
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard