Daily DAX : Day 465 ISDECIMAL
DAX ISDECIMAL Function
ISDECIMAL checks if a value has the decimal number data type in Power BI (also known as fixed-precision decimal / currency type).
Syntax
ISDECIMAL ( <value> )
| Parameter | Description |
|---|---|
| <value> | The expression or column value to test |
Return Value
- TRUE → value is a decimal number (fixed decimal / Currency type)
- FALSE → value is anything else (whole number, float/double, text, date, blank, etc.)
Important Notes
ISDECIMALis just another name (alias) for ISCURRENCY- In Power BI, "Decimal Number" usually means floating point (Double), while Fixed Decimal Number = Currency type = what ISDECIMAL detects
- Not supported in DirectQuery mode (calculated columns or RLS rules)
Common Use Cases
1. Clean mixed imported data (most common real-world use)
ValidCurrency =
IF(
ISDECIMAL ( 'Sales'[Amount Imported] ),
'Sales'[Amount Imported],
BLANK()
)
→ Only keeps values that are real decimal/currency type
2. Different formatting or calculation based on data type
Formatted Amount =
SWITCH(
TRUE(),
ISDECIMAL ( [Value] ), FORMAT ( [Value], "$#,##0.00" ),
ISNUMBER ( [Value] ), FORMAT ( [Value], "#,##0" ),
"–"
)
3. Detect legacy imported "money" columns
IsLegacyCurrencyColumn =
ISDECIMAL ( SELECTEDVALUE ( 'Fact'[Legacy Amount] ) )
→ Helps identify columns that came in as fixed-decimal instead of float
Quick Comparison Table
| Function | Returns TRUE for | Typical Use |
|---|---|---|
| ISNUMBER | Any number (Integer + Decimal + Float) | General number check |
| ISDECIMAL / ISCURRENCY | Only fixed decimal (Currency type) | Detect money/precision columns |
| ISINT64 | Whole numbers (64-bit integer) | Check pure integers |
Comments
Post a Comment