Short answer: FORMAT ( value, format_string [, locale] ) returns text: FORMAT ( 12345.67, "#,0.0" ) is "12,345.7", FORMAT ( TODAY (), "mmm yyyy" ) is "Oct 2026". Use it for labels, titles and text columns. Do not use it to format a numeric measure for a chart or a total: the measure becomes text, charts cannot plot it, and sorting goes alphabetical. For that, set the measure's format, or a dynamic format string (Format: Dynamic), which changes how a number looks while it stays a number.
People reach for FORMAT to show "1.2M" instead of 1,234,567. It works on a card and breaks everywhere else. Knowing when to use the format string instead saves a lot of rework.
Which number formats are there?
| Format string | Result | Note |
|---|---|---|
| "General Number" | 1234567.891 | no formatting |
| "Standard" | 1,234,567.89 | thousands separator, 2 decimals |
| "Currency" | $1,234,567.89 | the locale's currency |
| "#,0" | 1,234,568 | rounded, separators |
| "#,0.00" | 1,234,567.89 | 2 decimals |
| "0.0%" on 0.256 | 25.6% | one decimal |
| "#,0," | 1,235 | one comma before the end divides by 1,000 |
| "#,0.0,," | 1.2 | two commas divide by 1,000,000 |
| "#,0;(#,0);-" on -500 | (500) | sections: positive; negative; zero |
A custom format can have up to three sections separated by semicolons: positive, negative and zero values.
Which date codes are there?
| Code | Result | Code | Result |
|---|---|---|---|
| d | 29 | dddd | Thursday |
| dd | 29 | m | 10 |
| ddd | Thu | mm | 10 |
| mmm | Oct | mmmm | October |
| q | 4 | yy | 26 |
| yyyy | 2026 | hh:nn | 14:05 |
| "yyyy-mm" | 2026-10 | "\Qq yyyy" | Q4 2026 |
In format strings, m after h means minutes; use nn for minutes to be safe. A backslash shows the next character literally.
When is FORMAT the right tool?
-- dynamic title on a visual (Format, Title, fx)
Title Revenue = "Revenue " & FORMAT ( MAX ( 'Date'[Date] ), "mmmm yyyy" )
-- label text that combines a number and words
Revenue Label = FORMAT ( [Revenue], "#,0" ) & " EUR (" & FORMAT ( [Margin %], "0.0%" ) & " margin)"
-- calculated column for a sortable month label: sort it by a number column
Month Label = FORMAT ( 'Date'[Date], "mmm yyyy" )
-- a fixed locale, independent of the user
Revenue DE = FORMAT ( [Revenue], "#,0.00", "de-DE" )Text columns made with FORMAT sort alphabetically ("Apr" before "Jan"); set Sort by column to a number column (see date table).
How do dynamic format strings keep the number?
Select the measure, set Format to Dynamic, and write a DAX expression that returns the format string:
-- format string expression for [Revenue]
VAR V = ABS ( SELECTEDMEASURE ( ) )
RETURN
SWITCH (
TRUE (),
V >= 1e9, "#,0.0,,,\B",
V >= 1e6, "#,0.0,,\M",
V >= 1e3, "#,0.0,\K",
"#,0"
)The measure stays numeric: charts plot it, totals add up, sorting works, and the label shows 1.2M or 850.0K. Microsoft introduced dynamic format strings for exactly this problem with FORMAT; they also work in calculation groups.
What goes wrong?
- FORMAT on chart measures. Text cannot be plotted or summed; use the format string.
- FORMAT on BLANK. Returns an empty string, so rows with no data appear in tables; wrap in
IF ( NOT ISBLANK ( [x] ), FORMAT ( ... ) ). - Locale surprises. Separators and currency follow the model culture or the locale argument; test with users in other countries.
- m for minutes. Means month unless after
h; usenn. - .NET format codes. DAX uses Visual Basic style codes, so some .NET codes give unexpected results.
Where can you check this?
- Microsoft Learn: FORMAT function (DAX)
- Microsoft Learn: Custom numeric formats for the FORMAT function
- Microsoft Learn: Create dynamic format strings for measures
Where do you start?
Find measures wrapped in FORMAT that sit in charts and move the formatting into a dynamic format string. CONCATENATEX builds text from lists, the other half of labels.