DAX | Basic measures exercise | Create some measures to show aggregated film sales data

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

You can learn how to do this exercise if you attend the course listed below!

Software ==> DAX  (21 exercises)
Version ==>
Topic ==> Basic measures  (2 exercises)
Level ==> Relatively easy
Course ==> DAX
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Open the file in the above folder in Power BI Desktop.  It's missing a certain je ne sais quoi:

No measures

Measureless despair!

Create a table called Film measures to hold your measures:

Enter data icon

As a reminder, in Power BI you can click on this tool to start creating a new table.


Create a measure called Average Box Office to show the average box office takings for each film (dividing by 1,000,000 to make the figures more readable):

Average box office takings

You can right-click on the measure in the field well to apply conditional formatting by this measure (in this case to show that 12A Fantasy films have the highest average box office takings - although if you scroll down you'll find 12 certificate Romance films do even better).

Create another measure called Average Profit, to show the average difference between the box office takings and budget for each film:

Films shaded by results

Once more, 12A Fantasy films rule (although again, scrolling will reveal that 12 certificate Romance films do even better).

Because you're averaging an expression, you won't be able to use the standard AVERAGE function.

Create one more measure called Number of films to count the number of films for the filter context (use COUNTROWS).  Create a table on a separate page to show your measures:

Three measures

Inside information: depressingly, the two films which propel 12 certificate romantic films to the top of the list are Ghost and Titanic.

You can click on the Average profit column heading to sort the genres in descending average profit order (although you probably knew that already ...).

Save this as Just let go, then close it down.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post