DAX FORMAT function

Converts a value to text, using a format you choose.

FORMAT turns numbers and dates into text with a pattern: thousands separators, percentages, month names. Use it in labels and titles, not for numbers you still need to calculate with.

Syntax

FORMAT(<value>, <format_string>[, <locale_name>])
ArgumentRequiredDescription
valueRequiredThe number or date to format.
format_stringRequiredThe pattern, like "#,##0", "0.0%" or "mmm yyyy".
locale_nameOptionalA locale such as "en-US" for separators and month names.

Returns: A text.

Examples

Calculated on the free practice data (table financials), with [Total Sales] = SUM(financials[Sales]) and [Total Profit] = SUM(financials[Profit]).

1. A readable margin label

Margin Label = FORMAT(DIVIDE([Total Profit], [Total Sales]), "0.0%")
SegmentMargin Label
Channel Partners73.1%
Enterprise-3.1%
Government21.7%
Midmarket27.7%
Small Business9.8%
Total14.2%

Text, ready for a title or a card subtitle.

Good to know

  • The result is text: it sorts alphabetically and can't be summed. To change how a number looks in visuals, set the measure's format instead.

Related functions

Official reference: FORMAT function on Microsoft Learn