SIGN
1 for a positive number, -1 for a negative one, 0 for zero.
Group: Math. Compatible with DAX.
Syntax
SIGN ( <number> )
| Parameter | Type | Description |
|---|---|---|
number | Number | The number whose sign is wanted. |
Returns
Whole number. 1 when the number is above zero, -1 when it is below, 0 when it is zero.
Remarks
- Any positive number, however small, gives 1; any negative one gives -1.
- A blank gives BLANK, not 0.
- Handy to pick an arrow or a colour for a change:
SIGN ( [Liters change] )is 1 for growth and -1 for a fall.
Examples
Three signs and a blank
EVALUATE
ROW (
"Of -5", SIGN ( -5 ),
"Of 0", SIGN ( 0 ),
"Of 0.001", SIGN ( 0.001 ),
"Of blank", SIGN ( BLANK () )
)
| Of -5 | Of 0 | Of 0.001 | Of blank |
|---|---|---|---|
| -1 | 0 | 1 | (blank) |