Daily DAX : Day 445 ISCURRENCY
Power BI DAX Function: ISCURRENCY
Description
The ISCURRENCY function in DAX checks whether a value is of the currency data type (also known as fixed decimal or currency type in Power BI). It returns TRUE if the value is currency, otherwise FALSE.
Note: ISCURRENCY is an alias for ISDECIMAL, as the currency type in DAX is a fixed decimal number with exactly 4 decimal places.
Syntax
ISCURRENCY()
Parameters
: The expression or column value to check.
Return Value
A Boolean: TRUE if the value is of currency data type, FALSE otherwise.
Use Cases
- Validating data types in calculated columns or measures, especially when working with mixed data sources.
- Conditional logic where different calculations are needed based on whether a value is currency (e.g., financial reports).
- Debugging or ensuring proper type handling in complex DAX expressions involving unions or type conversions.
- Applying specific formatting or rounding only to currency-type values.
Example
-- Sample measure to check if a column value is currency
Is Currency Check =
IF (
ISCURRENCY ( Sales[Amount] ),
"Yes, this is a currency value",
"No, not currency"
)
This can be useful in scenarios with variant data types or when importing data that might mix numeric and currency types.
Comments
Post a Comment