OpenBI Docs Buy

FORMAT

A value as text in a format string, in the model's culture or one named.

Group: Text. Compatible with DAX.

Syntax

FORMAT ( <value>, <format_string> [, <locale_name>] )
ParameterTypeDescription
valueValueThe number or date to write; a text is returned as it is.
format_stringTextHow to write it: a pattern such as "#,0.00" or "yyyy-mm-dd", or the name of a format such as "Percent".
locale_nameText
optional
A culture to write it in, such as "nb-NO" or "de-DE"; the model's culture when left out.

Returns

Text. The value written as the format string says.

Remarks

  • Numbers: 0 is a digit that is always shown, # one shown only when needed, . the decimal point, , between digits the thousands separator, and % multiplies by 100 and shows the sign. Up to three sections split by ; are for positive numbers, negative ones and zero: "0;(0);zero".
  • Dates: d, dd, ddd, dddd for the day as 2, 02, Mon, Monday; m to mmmm for the month in the same way; yy and yyyy for the year; q for the quarter; h, hh, nn and ss for the time, with AM/PM for a 12-hour clock. An m right after an hour or before seconds means minutes.
  • A backslash shows the next character as it is ("\Qq yyyy" gives Q4 2026); longer text goes in double quotes, doubled inside a formula.
  • Names of formats are understood too, among them "Currency", "Percent", "Scientific", "General Number", "Short Date", "Long Date" and "Yes/No".
  • Month and day names, separators and the currency sign come from the model's culture, unless locale_name names another. The Example Brewery's culture is English (United States); a model that names no culture is formatted that way too.
  • A blank becomes empty text, not BLANK. A measure that returns FORMAT ( ... ) therefore shows a row for every item in a visual; keep the blank with IF ( ISBLANK ( x ), BLANK (), FORMAT ( x, ... ) ).
  • The result is text and sorts as text: Apr comes before Jan. Sort by a date or number column instead.

Examples

Patterns that read the same in every culture

EVALUATE
ROW (
    "ISO date", FORMAT ( DATE ( 2026, 11, 2 ), "yyyy-mm-dd" ),
    "Quarter", FORMAT ( DATE ( 2026, 11, 2 ), "\Qq yyyy" ),
    "Two digits", FORMAT ( 7, "00" ),
    "Negative", FORMAT ( -5, "0;(0)" ),
    "Blank", FORMAT ( BLANK (), "0" )
)
ISO dateQuarterTwo digitsNegativeBlank
2026-11-02Q4 202607(5)(empty text)

Numbers and dates in the model's culture

The Example Brewery's culture is English (United States).

EVALUATE
ROW (
    "Number", FORMAT ( 1234.5, "#,0.00" ),
    "Percent", FORMAT ( 0.256, "0.0%" ),
    "Month", FORMAT ( DATE ( 2026, 11, 2 ), "mmmm yyyy" ),
    "Currency", FORMAT ( 1234.5, "Currency" )
)
NumberPercentMonthCurrency
1,234.5025.6%November 2026$1,234.50

In another culture

EVALUATE
ROW (
    "Number", FORMAT ( 1234.5, "#,0.00", "nb-NO" ),
    "Date", FORMAT ( DATE ( 2026, 11, 2 ), "dddd d. mmmm yyyy", "nb-NO" ),
    "German", FORMAT ( 1234.5, "#,0.00", "de-DE" )
)
NumberDateGerman
1 234,50mandag 2. november 20261.234,50

FIXED, VALUE, CONCATENATE, DATE, USERCULTURE.

Last updated · OpenBI Studio 0.3.74