Level of detail example

What if you wanted to compare the average rental price for a single room to the overall average rental price for all rooms in the same building? It's fairly easy to get the average rental price per room:

In the preceding view, the view level of detail (level of detail defined by dimensions that are used in the view) is Building and Room because those are the dimensions in the view. So, the average rent is calculated per room per building.

It's also fairly easy to get the average area per Building by simply removing the apartment dimension from the view, as follows:

But what if you want to work with both the average rent per room and average rent per building in the same view? This is where level of detail calculations come into the picture.

There are several ways to approach this solution, but you might consider using an EXCLUDE level of detail calculation named Average Rent (exclude Room) with code like this:

{EXCLUDE [Room] : AVG(Rent)}

Then, you can use this in the view that includes Building and Room in the view level of detail to get results like this:

The AVG(Rent) field on the Measure Values shelf is performed at the view level of detail, so we are getting the average rent for every room for every building.

However, the Average Rent (exclude Room) field that's used on measures is calculated excluding the Room dimension, so it is calculated per Building (the only other dimension in the view). Now, we can see that the overall average for Beach Breeze is $1,750, while individual rooms in the building may have been higher or lower.

We'll consider an additional example or two of level of detail calculations in solving complex problems in Chapter 11Advanced Visualizations, Techniques, Tips, and Tricks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.144.229