Title: Delving into DAX’s FILTER Function in Power BI
Description:
The FILTER
function in DAX allows for row-level filtering of tables based on specific conditions. Understand and master its usage with this focused workout.
Scenario:
You’re analyzing a Power BI report on sales data. The dataset includes columns such as Product
, Quantity Sold
, Price
, and Region
. Employ the DAX FILTER
function to extract specific insights.
Objectives:
By the end of this workout, you should be able to:
-
Understand the syntax and usage of the
FILTER
function. -
Apply
FILTER
to derive specific subsets of data.
Interactive Task:
Given the following tasks, write or identify the correct DAX formula:
-
Create a new table that contains only products sold in the “West” region.
- Your Answer: ________________________
-
Derive a table showcasing products that were sold at a price greater than $50.
- Your Answer: ________________________
-
Given the following DAX formula, identify its output:
CALCULATE(SUM('Sales'[Price]), FILTER('Sales', 'Sales'[Quantity Sold] > 100))
Expected output:
-
i) Sum of prices for all products.
-
ii) Sum of prices for products sold more than 100 times.
-
iii) Average price for products sold more than 100 times.
-
iv) Number of products sold more than 100 times.
-
Questions:
-
What is the primary purpose of the
FILTER
function in DAX?-
i) To aggregate data.
-
ii) To create visualizations.
-
iii) To filter rows in a table based on conditions.
-
iv) To join multiple tables.
-
-
When using
FILTER
withinCALCULATE
, what does it typically modify?-
i) The base table for calculations.
-
ii) The aggregation function.
-
iii) The visual appearance of the report.
-
iv) The relationships between tables.
-
Duration: 20 minutes
Difficulty: Intermediate
Period:
This workout will be released on Wednesday, September 20, 2023, and will end on Thursday, October 05, 2023. But you can always come back to any of the workouts and solve them.