Computer Science
Grade 5
20 min
9. Data Visualization Tools: Tableau and Power BI
An introduction to popular data visualization tools like Tableau and Power BI, their features, and capabilities.
Tutorial Preview
1
Introduction & Learning Objectives
Learning Objectives
Explain what data visualization tools like Tableau and Power BI are used for.
Identify `if/elif/else` statements in Python code.
Use a `for` loop to process each item in a list.
Write a simple Python script that uses a `for` loop and an `if` statement to filter a list of numbers.
Use an `if/else` statement inside a loop to categorize data into two groups.
Explain why organizing data with Python makes it easier to create charts in other tools.
Ever wonder how your favorite game shows a leaderboard chart with the top players? 📊 Before a cool chart can be made, the data needs to be sorted and organized first!
In this lesson, we'll learn how to use Python's special 'control structure' commands, like `if` statements and `for` loops, to ge...
2
Key Concepts & Vocabulary
TermDefinitionExample
Data Visualization ToolA computer program like Tableau or Power BI that turns lists of data (like numbers and words) into cool pictures like charts, graphs, and maps.Using Power BI to turn a list of student birthdays into a bar chart showing how many birthdays are in each month.
Control StructureA command in Python that controls the 'flow' or order of the code. It tells the computer which lines to run, when to run them, and how many times.A `for` loop is a control structure that tells the computer to repeat a set of instructions for every item in a list.
Conditional Statement (if/else)A type of control structure that makes a choice. It checks if a condition is true and runs different code depending on the answer.`if score > 90: print('You got an A!&...
3
Core Syntax & Patterns
The `for` Loop Pattern
for item_variable in list_name:
# Code to repeat for each item
Use this when you want to do the same action for every single item in a list. The loop will take each item from `list_name`, one by one, put it into `item_variable`, and run the indented code.
The `if/else` Decision Pattern
if condition:
# Code to run if condition is true
else:
# Code to run if condition is false
Use this when your program needs to make a choice between two options. The computer checks the `condition`. If it's true, it runs the code under `if`. If it's false, it runs the code under `else`.
The Filtering Pattern
for item in list_name:
if condition_about_item:
# Do something with the item
This is a powerful combination. Use the `for`...
4 more steps in this tutorial
Sign up free to access the complete tutorial with worked examples and practice.
Sign Up Free to ContinueSample Practice Questions
Challenging
In an interactive Tableau dashboard, clicking on a state (e.g., 'Florida') filters all other charts to show only Florida's data. Which combination of Python concepts best models the dashboard's response to a click?
A.single 'while' loop that runs forever.
B.An 'if' statement that checks which state was clicked, which then triggers a 'for' loop to update each chart.
C.'for' loop that constantly cycles through the states waiting for a click.
D.variable that stores the name 'Florida'.
Challenging
A Power BI report has two binary (1/0) filters: 'IsMember' and 'UsedCoupon'. To show data for customers who are members AND used a coupon, the system checks if both values are 1. In binary arithmetic, what operation is equivalent to this 'AND' logic?
A.Addition (1 + 1)
B.Subtraction (1 - 1)
C.Multiplication (1 * 1)
D.Division (1 / 1)
Challenging
Your Tableau dashboard is slow because it loops through 10 million sales records to find the 5 records from today. What is a more efficient Python-like logic to speed this up?
A.Filter the data for today's date FIRST, then loop through the much smaller result (e.g., only 5 records).
B.Use a 'while' loop instead of a 'for' loop to go through the 10 million records.
C.Use a nested loop to check the date twice for each record.
D.Add all 10 million sales together and then divide by today's date.
Want to practice and check your answers?
Sign up to access all questions with instant feedback, explanations, and progress tracking.
Start Practicing Free