In the previous section of this chapter, we created some master measures by writing calculation expressions for each one. Expressions combine functions, fields, and math operators to calculate a desired value. These can be applied not only to measures, but also to titles, subtitles, footnotes, labels, and descriptions on Master items, chart colors, dimension limits, calculation conditions, and various other tools and places.
Here are some guidelines for writing expressions, as follows:
- An expression used on a measure will always have an aggregation function. The most common aggregation functions are sum(), max(), min(), and avg(). Aggregation functions require at least a field name as a parameter. Let's look at some examples:
- The sum(SalesAmount) calculates the summary of the SalesAmount field.
- The count (distinct OrderID) counts the distinct values...