Power BI | Calculated columns exercise | Create calculated columns to categorise length of episodes

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.

Software ==> Power BI  (111 exercises)
Version ==> Latest update
Topic ==> Calculated columns  (8 exercises)
Level ==> Average difficulty
Subject ==> Power BI training
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.

Create a new Power BI report, and load data from the Series worksheet in the Excel workbook in the above folder:

Worksheet to load

You only need to load this worksheet's data.


Use Query Editor to tidy up the Game of Thrones series data:

Game of Thrones episodes

Remove the row which has TBA for the number of viewers, remove the extra episodes column and change the data type and name of the viewers column to get something like the above.

Back in Power BI, use the DATEDIFF function to work out the difference in days for each series between when it first and last aired:

Duration column

Don't worry about the arguments for the function - Power BI should prompt you to complete them.


Now use an IF function to show for each series which category it belongs to using these rules:

Duration Category
Less than 60 days Short
Otherwise Long

Use this to create a pie chart showing the number of series for each category:

Pie chart

You don't have to add so much formatting - the person doing this exercise obviously had too much time on his or her hands!


Save your report as All too long really, 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