Concept Breakdown
DAX measures are calculations performed at query time, useful for aggregating data across multiple rows. COUNTROWS returns the number of rows in a table or rows remaining after filters have been applied. SUM calculates the sum of all numbers in a column. Measures can also combine these functions with arithmetic operators to derive new insights, such as averages or totals from multiple sources.
What You Will Learn
Understand when to use COUNTROWS, SUM, DIVIDE, basic arithmetic operators (+, *, ) in a Power BI model.
Practice the concept inside a real PBIX report rather than only reading syntax.
Complete a intermediate-level task and verify the result with a hidden answer check.
Practice in Power BI
The starter PBIX link has not been attached yet. The student workflow is ready for the admin to connect the file.
Download and unzip the 'Music Tours - Basic Measures.pbix' file.
Open the .pbix file in Power BI Desktop.
Add a new measure named 'Count Track' to the 'Music Measures' table that counts the rows of the 'Track' table.
Add the 'Count Track' measure to the card and table visuals.
Create a new measure named 'Avg Album Tracks' that divides 'Count Track' by the existing 'Count Album' measure.
Add the 'Avg Album Tracks' measure to the card visual only.
Add a new measure named 'Total Track Length (Seconds)' that calculates the sum of ('Track mins' * 60) + 'Track secs'.
Create another measure named 'Avg Track Length (Seconds)' that divides 'Total Track Length (Seconds)' by 'Count Track'.
Add 'Total Track Length (Seconds)' and 'Avg Track Length (Seconds)' to the card and table visuals.
Develop a final measure named 'Total US Sales (m)' that sums the 'US Sales (m)' field from the 'Album' table and adds it to the sum of the 'US Sales (m)' field from the 'Track' table.
Display the 'Total US Sales (m)' measure in both the card and table visuals.
Starter DAX
Count Album = COUNTROWS('Album')Expected Outcome
The Power BI report will display a card and a table visual, both updated with the new measures. The card will show a single value for each measure, while the table will show the measure values broken down by the album/track context, filtered by the slicer. All new measures (Count Track, Avg Album Tracks, Total Track Length (Seconds), Avg Track Length (Seconds), Total US Sales (m)) will be correctly calculated and displayed.