Component.GetCurrencySymbol
Get currency symbol for specific currency code. Returns the appropriate symbol for the given currency.
Syntax
DaxLib.FormatString.Component.GetCurrencySymbol ( currency_code )
Definition
DAX
// Get currency symbol based on currency code
// Returns currency symbol as a string (e.g., "$" or "€")
(
// Currency code (ISO 4217 three-letter code)
// Examples: CAD, EUR, GBP, JPY, etc.
currency_code: ANYREF
)
=>
VAR _Code =
SELECTEDVALUE ( currency_code )
VAR _Currency =
FILTER (
-- Calc. table with common currencies and formats
-- Optionally replace with your own, in-memory exchange rate table
DaxLib.FormatString.Component.CurrencyTable(),
''[Currency Code] = _Code
)
VAR _Symbol =
SELECTCOLUMNS ( _Currency, ''[Currency Symbol] )
RETURN
_Symbol
Parameters
| Parameter | Type | Description |
|---|---|---|
currency_code |
ANYREF | Column with the currency code (e.g., "USD", "EUR", "GBP"). Based on Component.CurrencyTable |
Example
DaxLib.FormatString.Component.GetCurrencySymbol ( 'Exchange Rate'[Currency] )
Use this function to get the currency symbol for a specific currency code.
Related Functions
- Component.GetCurrencyFormat - Get currency format string
- Component.GetCurrencyPosition - Get currency position
- Component.CurrencyTable - Full currency reference