Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In Multidimensional Expressions (MDX), unary operators perform an operation on a single operand, such as returning the negative or positive value of a numeric expression.
MDX supports the unary operators listed in the following table.
Operator | Description |
---|---|
- (Negative) | Returns the negative value of a numeric expression. |
+ (Positive) | Returns the positive value of a numeric expression. |
The following example demonstrates the use of a unary operator to return the negative value of a measure:
WITH
MEMBER [Measures].[NegDiscountAmount] AS
-[Measures].[Discount Amount]
SELECT
{[Measures].[Discount Amount],[Measures].[NegDiscountAmount]} on COLUMNS,
NON EMPTY [Product].[Product].MEMBERS ON Rows
FROM [Adventure Works]
WHERE [Product].[Category].[Bikes]
In addition, MDX uses special unary operators to determine the aggregation operation performed by the RollupChildren function. For more information on these special unary operators, see Add a Custom Aggregation to a Dimension.
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today