<!-- https://learnsql.cpetoday.com/functions/dax/format -->
# FORMAT

Language: DAX
Category: Text
Syntax: FORMAT(<value>, <format_string> [, <locale_name>])
Summary: Converts a value to text using a format pattern such as currency, percent or date.
Returns: Text (a scalar).
Level: Beginner
Related: CONCATENATE, CONCATENATEX, VALUE, ROUND, SELECTEDVALUE, DIVIDE

## What it does
FORMAT turns a number or a date into text in the shape you describe, such as "$1,234", "12.5%" or "Mar 2026". It is useful for titles, labels and tooltips that must include a value. The result is text, so it cannot be summed, sorted as a number or used in a calculation. For the number that a chart or a card shows, set the format in the measure, not with FORMAT.

## Syntax and arguments
- value: the number, date or measure to format.
- format_string: a pattern such as "#,0" for whole numbers with a thousands separator, "0.0%" for a percentage with one decimal, or "MMM yyyy" for month and year.
- locale_name (optional): a language and region code that changes the separators and the names of months.

## Example
The dashboard title should state the period in words and show the total sales in dollars, so a printed page is clear without the slicers.

```dax
Dashboard Title =
"Sales for " & FORMAT(MAX('Date'[Date]), "MMMM yyyy")
    & ", total " & FORMAT([Total Sales], "$#,0")
```

If the latest date in the filter is in March 2026, the title reads "Sales for March 2026" followed by the total in whole dollars. The title updates when the slicer changes.

## Example: a second, different use
A tooltip that shows the margin percentage with one decimal place and a word label:

```dax
Margin Tooltip = "Margin " & FORMAT([Gross Margin %], "0.0%")
```

The percentage is rounded for display only. The measure keeps its full value for other calculations.

## Things to watch
- FORMAT returns text. A text value does not add up, does not sort as a number and does not work with a chart axis. Keep numeric measures as numbers.
- Use the format string of the measure in the model for the number that a visual shows. That keeps the value numeric.
- Format strings are sensitive to locale. A comma may mean a thousands separator in one country and a decimal point in another.
- Converting a date with FORMAT in a calculated column can break date sorting. Keep the date and format for display only.
- Do not use FORMAT to round a value. Use ROUND for that, and FORMAT only for what the reader sees.

## In business terms
FORMAT builds the titles, footnotes and commentary text in finance packs: the period covered, the amount reported, the variance in percent. It keeps the words of a report in step with the numbers when the filters change.
