Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this page:

...

Table of Contents

Simple arithmetic calculations

...

[Measures].[Store Sales] / ([Measures].[Store Sales], [Customers].CurrentMember.Parent)

Please see also DefaultContext function documentation which can be used to override the context for evaluation of measures.

...

You can calculate different aggregated values, like, sum, average, median, count, minimal and maximal values, over the set of dimension members

  • Sum(set, numeric_expression) calculates numeric_expression for each set member and returns a sum of all these results. For example, Sum(LastPeriods(3), [Measures].[Store Sales]) will calculate the total sales for the last three Time periods starting from the current Time dimension member. There is an example of how Sum() could be used.

  • Count(set) returns a count of set members. Count(set, ExcludeEmpty) will return a count of set members for which corresponding measure values are not empty. There is an example of how Count() could be used.

  • Avg(set, numeric_expression) calculates the average of numeric_expression in set. There is an example of how Avg() could be used.

  • Max(set, numeric_expression) returns the maximum value of numeric_expression in set

  • Min(set, numeric_expression) returns the minimum value of numeric_expression in set

  • Median(set, numeric_expression) returns the median value of numeric_expression in set

Before you create the calculated measure to get the Average, Median, Min, or Max value, check whether you could use standard functionality Add calculated → Statistical → Average/Median/Min/Max to show those values in the report. For more details on this functionality see documentation on Add standard calculations based on a selected measure.

For more details on how to construct calculated measure with sets check the training video below:

...

Time difference calculations

...

If you want to select a subset of Time dimension level members between specified dates then you can use the DateBetween function to filter level members using a date range expressions. For example, the following expression will return set of last 7 days from [Time].[Day] level members:

...