POWER BI EXERCISES▼
DAX | Calculated columns exercise | Create a calculated column using the DIVIDE function
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 one of more of the courses listed below!
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 Power BI file in the above folder. You should see that it contains a list of the 61 tallest buildings in the world at the time of writing:
Well, the 60 tallest buildings and one ringer at the bottom ...
Create a calculated column in the Buildings table to show the average height of each floor for each building (divide the Metres column by the Floors column):
If you add this column to your table and sort by it, you'll see Giant Owl Towers appears at the top.
The problem is that this building has zero floors (this looks like a sloppy data input error on the part of the Wise Owl exercises team). Amend your formula so that it shows a blank for the average floor height for buildings with no floors:
Much better - if you sort the buildings in ascending order by average floor height, Giant Owl Towers appears at the top of the list.
There are at least 3 ways to do this, using either DIVIDE, ISERROR or IF. Which do you think is the best solution?
Save your Power BI file as GOT a problem, then close it down.