Formulas let a semantic query compute values that are not stored directly in the model. You write a formula as an expression string — combining field references, operators, literals, and functions — and the Semantic Query API evaluates it as part of the query. Formulas power calculated dimensions and calculated measurements: a calculated dimension groups or filters rows by a computed value, while a calculated measurement aggregates a computed value.
There are two ways to bring a formula into a query:
Model-defined calculated fields. The formula is authored once in the Semantic Data Model as a SemanticCalculatedDimension or SemanticCalculatedMeasurement, and the query references it by name through a semantic_field expression.
On-the-fly calculated fields. The formula is supplied directly in the request as a calculated_field expression, without being persisted to the model. Use this for query-scoped computations.
Formula expressions use the Tua dialect, which references fields with bracket notation [Table].[Field] and supports level-of-detail (LOD) expressions and table calculations. A calculated field declares its dialect with the syntax property ("Tua"); when a request carries an inline semanticModel, Tua is the default. The Function reference below documents the full Tua function library.
Metadata in the model
Calculated fields can be defined at authoring time as part of the Semantic Data Model, so their formulas are reusable across queries. A calculated dimension is authored as a SemanticCalculatedDimension; a calculated measurement is authored as a SemanticCalculatedMeasurement. Each carries an apiName, a dataType, an expression, a syntax, and (for measurements) an aggregationType and a level. For the full authoring field schema, see Semantic Calculated Dimension and Semantic Calculated Measurement in the Authoring API.
To compute a value without persisting it to the model, place a calculated_field object inside a fields[] entry’s expression. A calculated_field has a name, an expression string, an optional syntax, and exactly one of calculated_measure_expression (for an aggregated numeric result) or calculated_dimension_expression (for a grouping value).
A calculated measurement declares its output type under calculated_measure_expression:
Expressions combine values with arithmetic, comparison, and logical operators. Operators evaluate in the following order, from highest to lowest precedence:
Parentheses ( )
Unary minus -
Exponentiation ^
Multiplication, division, modulo */%
Addition, subtraction +-
Comparisons ><>=<==!=
IN
NOT
AND
OR
Use parentheses to make grouping explicit. Arithmetic combines aggregates, fields, parameters, and literals — this on-the-fly measurement adds a parameter value to a summed field:
ROUND(value, places) rounds to a given number of decimal places, and ABS(value) returns absolute value. This model-defined table calculation uses ABS in a period-over-period growth formula:
String functions build and transform text. CONCAT(...) joins strings, and TEXT(value) converts a value to text — combined here to format a fiscal-period label:
LEFT(text, count) returns the leftmost characters. STR(value) converts a value to a string, and text values concatenate with +. This model-defined calculated dimension formats a rounded score with a text suffix:
Date functions extract, truncate, and construct date and datetime values. DATE_TRUNC(part, datetime) truncates a datetime to a given part, and DATETIMEVALUE(...) produces a datetime value:
DATEPART(part, date) returns a numeric component of a date, such as the year. This calculated dimension extracts the year from another calculated field:
Fiscal date functions return fiscal-calendar components. FISCAL_YEAR(date) returns the fiscal year and FISCAL_QUARTER(date) returns the fiscal quarter for a date:
Conditional expressions branch on a condition. The IF ... THEN ... ELSEIF ... ELSE ... END form returns different values per branch; IN tests membership in a value list. This model-defined measurement returns an amount only for matching forecast categories:
ISNULL(expression) returns whether a value is null, and ZN(expression) converts a null numeric result to zero. The growth formula above uses ZN so that missing sales values participate in arithmetic as zero:
Aggregation functions collapse many rows into a single measurement value. Common ones include SUM, MIN, MAX, AVG, COUNT, COUNTD (distinct count), and MEDIAN — this is a representative sample, not the full list. For every supported aggregation function (including PERCENTILE, CORR, COVAR, COVARP, STDEV, STDEVP, VAR, and VARP), see Aggregation in the Function reference below. COUNTD counts distinct values of a field:
When a calculated field wraps an aggregation, set the field’s aggregation method to SEMANTIC_AGGREGATION_METHOD_USER_AGG so the expression’s own aggregation is used rather than an outer one. Aggregate expressions also appear in Top-N criteria — here MEDIAN ranks dimension values:
Table calculations compute across the ordered result set — running totals, moving averages, rankings, and offset lookups. A calculated measurement authored at levelTableCalc carries a window function. WINDOW_AVG(expression, start, end) averages a measure over a sliding window of rows:
LOOKUP(expression, offset) returns a measure’s value from a row offset by a given number of positions — negative offsets look backward. The period-over-period formula uses LOOKUP(..., -1) to reference the prior row:
Table calculations use a PARTITION/ORDERBY window frame. The frame partitions rows by one set of columns, orders within each partition, and applies an analytics function. RANK(measure) assigns a rank within the ordered partition:
The ORDERBY clause accepts sort direction (ASC / DESC) and null placement (NULLS FIRST / NULLS LAST). Table-calculation expressions can also be used inside filters — this filter selects rows by an ordered index computed with an ORDERBY frame:
Identity functions return values about the current user. USERID() returns the running user’s ID; combine it with LEFT to compare on a 15-character ID prefix. This model-defined calculated dimension marks rows owned by the current user:
1{2 "apiName": "FFact_owner_opp_history_lv_clc",3 "label": "FFact owner - opp history lv",4 "dataType": "Boolean",5 "expression": "LEFT([SW_FF_OPP_HIS_PA_lv].[Forecasting_Fact10_Owner], 15) = LEFT(USERID(), 15)"6}
Referencing parameters in formulas
A formula can reference a model parameter with bracket notation, as [Parameters].[<name>]. This on-the-fly measurement adds a parameter value to a summed field:
You can annotate expressions with comments. Line comments (//) and block comments (/* */) are ignored during evaluation.
Function reference
These are the built-in functions available in Tua formula expressions, as exposed in the Semantic Data Model authoring UI. Operators and precedence are covered in the Operators and precedence section above.
Functions differ in how they evaluate, which determines whether the calculated field is a dimension or a measurement:
Row-level (scalar) — evaluates independently for each row and returns one value per row. Math, String, Date/Fiscal, Conditional & Null, and AI & Predictive functions are row-level, and typically define a calculated dimension.
Aggregate — collapses the rows in a group into a single measurement value. When a calculated field wraps an aggregate expression, set its aggregation method to SEMANTIC_AGGREGATION_METHOD_USER_AGG so the expression’s own aggregation is honored (see Limitations).
Window (table calculation) — returns one value per row, computed over an ordered partition of neighboring rows. These require a PARTITION/ORDERBY frame.
Level of detail — computes an aggregation at a dimensionality you specify, independent of the query’s grouping.
Each category below notes which evaluation applies.
Math
Evaluation: Row-level. The exceptions are MAX and MIN: with two arguments they are row-level (the larger/smaller of the two values per row); applied to a single field they act as an aggregate over the group.
Function
Return type
Description
MAX(expr1, expr2)
Dynamic
Returns the maximum of the two arguments, which must be of the same data type. MAX can also be applied to a single field as an aggregation — see Aggregation.
MIN(expr1, expr2)
Dynamic
Returns the minimum of the two arguments, which must be of the same data type. MIN can also be applied to a single field as an aggregation — see Aggregation.
ROUND(number, [decimals])
Number
Rounds to a specified number of digits. The optional decimals argument specifies how many decimal points of precision to include in the final result. If decimals is omitted, number is rounded to the nearest integer.
RANDOM()
Number
Returns a random decimal number in the following range 0.0 <= x < 1.0.
INT(expression)
Number
Casts its argument as an integer.
CEILING(number)
Number
Rounds a to the nearest integer of equal or greater value.
FLOOR(number)
Number
Rounds a number to the nearest of equal or lesser value.
POWER(number, power)
Number
Raises the to the specified .
SIN(number)
Number
Returns the sine of an angle.
COS(number)
Number
Returns the cosine of an angle.
TAN(number)
Number
Returns the tangent of an angle.
COT(number)
Number
Returns the cotangent of an angle.
ACOS(number)
Number
Returns the arccosine (angle) of the given .
ASIN(number)
Number
Returns the arcsine (angle) of a given .
ATAN(number)
Number
Returns the arctangent (angle) of a given .
ATAN2(y number, x number)
Number
Returns the arctangent (angle) between two numbers (x and y). The result is in radians.
PI()
Number
Returns the numeric constant pi: 3.14159…
LN(number)
Number
Returns the natural logarithm of a .
RADIANS(number)
Number
Converts the given from degrees to radians.
DEGREES(number)
Number
Converts an angle in radians to degrees.
ABS(number)
Number
Returns the absolute value of the given .
DIV(integer1, integer2)
Number
Returns the integer part of a division operation, in which is divided by .
SIGN(number)
Number
Returns the sign of a : The possible return values are -1 if the number is negative, 0 if the number is zero, or 1 if the number is positive.
SQUARE(number)
Number
Returns the square of a .
EXP(number)
Number
Returns e raised to the power of the given .
LOG(number, [base])
Number
Returns the logarithm of a for the given . If the optional base argument isn’t present, base 10 is used.
FLOAT(expression)
Number
Casts its argument as a floating point number.
String
Evaluation: Row-level.
Function
Return type
Description
CONTAINS(string, substring)
Boolean
Compares two arguments of text and returns TRUE if the first argument contains the second argument. If not, returns FALSE.
LEN(string)
Number
Returns the length of the string.
LOWER(string)
Text
Returns the provided in all lowercase characters.
REPLACE(string, substring, replacement)
Text
Searches for and replaces it with . If is not found, the string is not changed.
UPPER(string)
Text
Returns the provided in all uppercase characters.
SPLIT(string, delimiter, token number)
Text
Returns a substring from a string, using a delimiter character to divide the string into a sequence of tokens.
TRIM(string)
Text
Returns the provided with leading and trailing spaces removed.
LEFT(string, number)
Text
Returns the left-most of characters in the string.
RIGHT(string, number)
Text
Returns the right-most of characters in the string.
STR(expression)
Text
Casts its argument as a string.
FIND(string, substring, [start])
Number
Returns the index position of substring in string, or 0 if the substring isn’t found. The first character in the string is position 1. If the optional numeric argument start is added, the function ignores any instances of substring that appear before the starting position.
FINDNTH(string, substring, occurrence)
Number
Returns the position of the nth occurrence of substring within the specified string, where n is defined by the occurrence argument.
REGEXP_REPLACE(string, pattern, replacement)
Text
Returns a copy of the given string where the regular expression pattern is replaced by the replacement string.
REGEXP_MATCH(string, pattern)
Boolean
Returns true if a substring of the specified string matches the regular expression pattern.
REGEXP_EXTRACT(string, pattern)
Text
Returns the portion of the string that matches the regular expression pattern.
REGEXP_EXTRACT_NTH(string, pattern, index)
Text
Returns the portion of the string that matches the regular expression pattern. The substring is matched to the nth capturing group, where n is the given index. If index is 0, the entire string is returned.
RTRIM(string)
Text
Returns the provided with any trailing spaces removed.
LTRIM(string)
Text
Returns the provided with any leading spaces removed.
PROPER(string)
Text
Returns the provided with the first letter of each word is capitalized and the remaining letters are in lowercase.
ASCII(string)
Number
Returns the ASCII code for the first character of a .
MID(string, start, [length])
Text
Returns a string starting at the specified start position. The first character in the string is position 1. If the optional numeric argument length is added, the returned string includes only that number of characters.
STARTSWITH(string, substring)
Boolean
Returns true if string starts with substring. Leading white spaces are ignored.
ENDSWITH(string, substring)
Boolean
Returns true if the given ends with the specified . Trailing white spaces are ignored.
SPACE(number)
Text
Returns a string that is composed of the specified number of repeated spaces.
Date/Fiscal
Evaluation: Row-level.
Function
Return type
Description
DATEADD(date_part, interval, date)
Date (or DateTime)
Returns the with the specified number added to the specified <date_part> of that date. For example, adding three months or 12 days to a starting date.
MAKEDATE(year, month, day)
Date
Returns a date value constructed from the specified , , and .
DATEPART(date_part, date, [start_of_week])
Number
Returns the name of the specified date part as an integer.
DATE(expression)
Date
Returns a date given a number, string, or date .
DATEPARSE(date_format, date_string)
DateTime
Returns specifically formatted strings as dates.
TODAY()
Date
Returns the current date as a date data type.
DATETRUNC(date_part, date, [start_of_week])
Date (or DateTime)
This function can be thought of as date rounding. It takes a specific date and returns a version of that date at the desired specificity. Because every date must have a value for day, month, quarter, and year, DATETRUNC sets the values as the lowest value for each date part up to the date part specified. Refer to the example for more information.
Returns the number of date parts (weeks, years, etc) between two dates.
DATENAME(date_part, date, [start_of_week])
Text
Returns <date_part> of as a string.
DATETIME(expression)
DateTime
Returns a datetime given a number, string, or date expression.
QUARTER(date)
Number
Returns the quarter of the given as an integer.
ISDATE(string)
Boolean
Returns true if a given is a valid date.
NOW()
DateTime
Returns the current local system date and time.
MAKETIME(hour, minute, second)
DateTime
Returns a date value constructed from the specified , , and .
MAKEDATETIME(date, time)
DateTime
Returns a datetime that combines a and a
ISOWEEK(date)
Number
Returns the ISO8601 week-based week of a given as an integer.
ISOYEAR(date)
Number
Returns the ISO8601 week-based year of a given date as an integer.
ISOQUARTER(date)
Number
Returns the ISO8601 week-based quarter of a given as an integer.
ISOWEEKDAY(date)
Number
Returns the ISO8601 week-based weekday of a given as an integer.
DAY(date)
Number
Returns the day of the given as an integer.
WEEK(date)
Number
Returns the week of the given as an integer.
MONTH(date)
Number
Returns the month of the given as an integer.
YEAR(date)
Number
Returns the year of the given as an integer.
Functions that take a date_part argument (such as DATEADD, DATEPART, DATETRUNC, DATEDIFF, and DATENAME) accept these values: year, quarter, month, week, day, dayofyear, weekday, hour, minute, second, milliseconds, iso-year, iso-quarter, iso-week, and iso-weekday. Fiscal-calendar variants — fiscal_year, fiscal_quarter, fiscal_month, and fiscal_week — are also accepted, and follow the model’s fiscal-year configuration.
Conditional & Null
Evaluation: Row-level.
Function
Return type
Description
CASE <expression> WHEN <value> THEN <result> [WHEN ...] [ELSE <default>] END
Dynamic
Evaluates the expression and compares it to the specified options (, , etc.). When a value that matches expression is encountered, CASE returns the corresponding return. If no match is found, the (optional) default is returned. If there is no default and no values match, then Null is returned.
IF <test> THEN <result> [ELSEIF <test> THEN <result> ...] [ELSE <default>] END
Dynamic
Tests a series of expressions and returns the value for the first true .
IIF(<test>, <then>, <else>, [<unknown>])
Dynamic
Checks whether a condition is met (), and returns if the test is true, if the test is false, and an optional value for if the test is null. If the optional unknown isn’t specified, IIF returns null.
NOT <expression>
Boolean
Performs logical negation on an expression.
<expr1> IN <expr2>
Boolean
Returns TRUE if any value in matches any value in .
IFNULL(expr1, expr2)
Dynamic
Returns if it’s non-null, otherwise returns .
ZN(expression)
Number
Returns if it isn’t null, otherwise returns zero.
ISNULL(expression)
Boolean
Returns true if the is NULL (does not contain valid data).
The IF and CASE functions support multi-line syntax with the keywords THEN, ELSE, ELSEIF (for IF), WHEN (for CASE), and END:
1IF <test1> THEN <then1>2ELSEIF <test2> THEN <then2>3...4[ELSE <default>]5END
1CASE <expression>2WHEN <value1> THEN <then1>3WHEN <value2> THEN <then2>4...5[ELSE <default>]6END
Aggregation
Evaluation: Aggregate. Each function collapses the rows in a group into a single measurement value. Set the calculated field’s aggregation method to SEMANTIC_AGGREGATION_METHOD_USER_AGG when wrapping one of these (see Limitations).
Function
Return type
Description
COUNTD(expression)
Number
Returns the number of distinct items in a group. Null values are not counted.
MAX(expression)
Dynamic
Returns the maximum of a single field as an aggregation. MAX applied to two arguments is a row-level function — see Math.
MIN(expression)
Dynamic
Returns the minimum of a single field as an aggregation. MIN applied to two arguments is a row-level function — see Math.
AVG(expression)
Number
Returns the average of all the values in the expression. Null values are ignored.
MEDIAN(expression)
Number
Returns the median of an expression across all records. Null values are ignored.
COUNT(expression)
Number
Returns the number of non-distinct items in a group. Null values are not counted.
SUM(expression)
Number
Returns the sum of all values in the expression. Null values are ignored.
PERCENTILE(expression, number)
Number
Returns the percentile value from the given expression corresponding to the specified . The must be between 0 and 1 (inclusive) and must be a numeric constant.
CORR(expression1, expression2)
Number
Returns the Pearson correlation coefficient of two expressions.
COVAR(expression1, expression2)
Number
Returns the sample covariance of two expressions.
COVARP(expression 1, expression2)
Number
Returns the population covariance of two expressions.
STDEV(expression)
Number
Returns the statistical standard deviation of all values in the given based on a sample of the population.
STDEVP(expression)
Number
Returns the statistical standard deviation of all values in the given based on a biased population.
VAR(expression)
Number
Returns the statistical variance of all values in the given based on a sample of the population.
VARP(expression)
Number
Returns the statistical variance of all values in the given on the entire population.
Window & Table Calc
Evaluation: Window (table calculation). Each function returns one value per row, computed over an ordered partition; it requires a PARTITION/ORDERBY frame (or window bounds). A table calculation must act on an aggregate expression (for example SUM([Sales])) or wrap another table calculation — it cannot be applied directly to a row-level expression.
Wrap a table calculation in a PARTITION/ORDERBY block that defines the partition and the sort order it operates over:
PARTITION/ORDERBY blocks can’t be saved as a persistent calculated field in the model — pass them at query time on an on-the-fly calculated_field.
Function
Return type
Description
FIRST()
Number
Returns the number of rows from the current row to the first row in the partition. For example, the view below shows quarterly sales. When FIRST() is computed within the Date partition, the offset of the first row from the second row is -1.
LAST()
Number
Returns the number of rows from the current row to the last row in the partition. For example, the table below shows quarterly sales. When LAST() is computed within the Date partition, the offset of the last row from the second row is 5.
RANK(expression, ['asc' | 'desc'])
Number
Returns the standard competition rank for the current row in the partition. Identical values are assigned an identical rank.
RANK_DENSE(expression, ['asc' | 'desc'])
Number
Returns the dense rank for the current row in the partition. Identical values are assigned an identical rank, but no gaps are inserted into the number sequence.
RANK_MODIFIED(expression, ['asc' | 'desc'])
Number
Returns the modified competition rank for the current row in the partition. Identical values are assigned an identical rank.
RANK_PERCENTILE(expression, ['asc' | 'desc'])
Number
Returns the percentile rank for the current row in the partition.
RANK_UNIQUE(expression, ['asc' | 'desc'])
Number
Returns the unique rank for the current row in the partition. Identical values are assigned different ranks.
RUNNING_AVG(expression)
Number
Returns the running average of the given expression, from the first row in the partition to the current row.
RUNNING_COUNT(expression)
Number
Returns the running count of the given expression, from the first row in the partition to the current row.
RUNNING_MAX(expression)
Number
Returns the running maximum of the given expression, from the first row in the partition to the current row.
RUNNING_MIN(expression)
Number
Returns the running minimum of the given expression, from the first row in the partition to the current row.
RUNNING_SUM(expression)
Number
Returns the running sum of the given expression, from the first row in the partition to the current row.
TOTAL(expression)
Number
Returns the total for the given expression in a table calculation partition.
WINDOW_AVG(expression, [start, end])
Number
Returns the average of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
Returns the Pearson correlation coefficient of two expressions within the window. The window is defined as offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If start and end are omitted, the entire partition is used.
WINDOW_COUNT(expression, [start, end])
Number
Returns the count of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
Returns the sample covariance of two expressions within the window. The window is defined as offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end arguments are omitted, the window is the entire partition.
Returns the population covariance of two expressions within the window. The window is defined as offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If start and end are omitted, the entire partition is used.
WINDOW_MAX(expression, [start, end])
Number
Returns the maximum of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
WINDOW_MIN(expression, [start, end])
Number
Returns the minimum of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
WINDOW_STDEV(expression, [start, end])
Number
Returns the sample standard deviation of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
WINDOW_STDEVP(expression, [start, end])
Number
Returns the biased standard deviation of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
WINDOW_SUM(expression, [start, end])
Number
Returns the sum of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
WINDOW_VAR(expression, [start, end])
Number
Returns the sample variance of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
WINDOW_VARP(expression, [start, end])
Number
Returns the biased variance of the expression within the window. The window is defined by means of offsets from the current row. Use FIRST()+n and LAST()-n for offsets from the first or last row in the partition. If the start and end are omitted, the entire partition is used.
INDEX()
Number
Returns a unique sequential row ID to each row.
LOOKUP(expression, offset)
Dynamic
Returns the value of the expression in a target row, specified as a relative offset from the current row. Use FIRST() + n and LAST() - n as part of your offset definition for a target relative to the first/last rows in the partition. This function returns NULL if the target row cannot be determined.
SIZE()
Number
Returns the number of rows in the partition.
Like all table calculations, these functions act on an aggregate expression or wrap another table calculation — not a row-level expression.
TOTAL is grouped with table calculations because of its evaluation scope, but it behaves differently from the row-oriented functions above (such as RANK or RUNNING_SUM). Instead of computing per row, TOTAL re-runs the underlying aggregation at the grain defined by the PARTITION clause — conceptually similar to a Level of Detail expression, but scoped to the table calculation’s partition rather than a fixed set of dimensions.
Level of Detail
Evaluation: Level of detail. Each expression computes an aggregation at the dimensionality you specify, independent of the query’s grouping.
EXCLUDE level of detail expressions declare dimensions to omit from the view level of detail.
{ INCLUDE [dimension 1], … ,[dimension n] : AGGREGATION_FUNCTION(expression) }
Dynamic
INCLUDE level of detail expressions compute values using the specified dimensions in addition to whatever dimensions are in the view.
A FIXED LOD is computed before the query’s dimension filters, so ordinary dimension filters do not reduce the rows it scans — they apply only to the outer query, not to the FIXED calculation. INCLUDE and EXCLUDE LODs are computed after dimension filters, so those filters do apply to their calculation. To constrain a FIXED calculation’s scope, use a context filter, which applies before the FIXED LOD is computed.
AI & Predictive
Evaluation: Row-level.
Function
Return type
Description
AI_SENTIMENT([tablename].[fieldname])
Text
Classifies the input in one of the following sentiments: positive, negative, or neutral.
A calculated field is either a measurement or a dimension, not both. Supply exactly one of calculated_measure_expression or calculated_dimension_expression per calculated_field.
Wrapped aggregations use USER_AGG. When an expression contains its own aggregation function (for example COUNTD(...) or a TableCalc-level formula), set the field’s aggregation method to SEMANTIC_AGGREGATION_METHOD_USER_AGG so the expression’s aggregation is honored.
Table calculations require an ordering. Window and ranking functions evaluate over an ordered frame; a table-calculation formula specifies its PARTITION and ORDERBY (or window bounds) so row order is well-defined.
Reference parameters with bracket notation. Reference a model parameter in a formula as [Parameters].[<name>].
Calculated dimensions can only use FIXED LOD expressions.EXCLUDE and INCLUDE depend on the view’s grouping, which isn’t defined for a field that itself supplies grouping — use them only in calculated measurements.