Format Measures
You can apply letters or symbols before or after the numeric value, such as for currency, perform decimal rounding, and add grouping and decimal separators.
XMD doesn’t update formatting for user input or context-driven fields. Formatting can only be applied to a static or preset value.
In this example lens, the values in the Sales column don’t include decimals or currency symbols.

To relabel the Sales field and format its values, modify the XMD as indicated in the bold text.
The field now has the label “Sales (USD)” and its values include a currency symbol and two decimal places.

The following SAQL query contains a derived measure that calculates the average revenue per employee. As shown, the values in this derived field aren’t formatted.

To relabel the RevPerEmployee field and format its values, modify the XMD as indicated in the bold text.
The field now has the label “Revenue Per Employee” and its values include a currency symbol and a grouping separator.

Check out these examples that illustrate how to use symbols to format measures and derived measures.
For information about using symbols in the customFormat field, see Measures and Derived Measures in XMD.
| Goal | XMD |
|---|---|
| Display 500000 as $500,000 (prefix with ”$“) | See Example 1 below |
| Display 500000 as $500,000 (prefix with ”$”, include grouping separator) | See Example 2 below |
| Display 500000 as $500,000.00 (prefix with ”$”, include grouping separator, apply 2 decimal places) | See Example 3 below |
| Display 500000 as –$500,000.00USD (prefix with ”–$”, include grouping separator, apply 2 decimal places, suffix with “USD”) | See Example 4 below |
| Display Canadian currency code as a suffix (include grouping separator, apply 2 decimal places, suffix with “CAD”) | See Example 5 below |
Display -1,234.56 as –$1,234.56 (use a semi-colon delimiter for negatives, pos;neg) | See Example 6 below |
Display -1,234.56 as ($1,234.56) (Optional. Use a semi-colon delimiter, parenthesis for negatives, pos;(neg)) | See Example 7 below |
(Use a semi-colon delimiter for negatives, pos;neg)
(Optional. Use a semi-colon delimiter, parenthesis for negatives, pos;(neg))
(Optional. Use a semi-colon delimiter, ’-’ after the second delimiter, pos;neg;zero)