Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Power BI Desktop and Power BI service
Power BI provides several ways to control how a number or date displays. Some options are part of the semantic model, so they apply in every report that uses the model. Other options are set in a report and apply only to that report, a visual, or part of a visual.
This article describes each option, which option takes precedence, and which format string syntax each option uses.
How format strings work
A format string changes how a value is shown, not the value itself. The underlying number or date stays the same, so calculations, sorting, and filtering still use the full value.
For example, a measure that stores the number 1234.5678 displays differently depending on its format string:
| Format string | Displays as | Stored value |
|---|---|---|
| None | 1234.5678 | 1234.5678 |
#,##0 |
1,235 | 1234.5678 |
#,##0.00 |
1,234.57 | 1234.5678 |
$#,##0.00 |
$1,234.57 | 1234.5678 |
0.00E+00 |
1.23E+03 | 1234.5678 |
The same rule applies to dates. A column that stores September 4, 2025, 3:07:08 PM displays differently depending on its format string:
| Format string | Displays as | Stored value |
|---|---|---|
m/d/yyyy |
9/4/2025 | September 4, 2025, 3:07:08 PM |
mmm d, yyyy |
Sep 4, 2025 | September 4, 2025, 3:07:08 PM |
dddd, mmmm d |
Thursday, September 4 | September 4, 2025, 3:07:08 PM |
h:nn AM/PM |
3:07 PM | September 4, 2025, 3:07:08 PM |
Because the stored value doesn't change, a date formatted as mmm d, yyyy still includes its time, and a sum of values formatted as #,##0 uses the decimals that the format hides.
Ways to control how numbers and dates display
You can control display in the semantic model, in the report, or both.
In the semantic model
| Option | How you set it | Applies to | Returns |
|---|---|---|---|
| Model format string | Select a format from the Format dropdown or enter a Custom format string in the Properties pane or on the ribbon. You can also set the formatString property in TMDL. |
Columns and measures, in every report that uses the model | Number or date |
| Dynamic format string | Write a DAX expression that returns a format string based on context, such as a currency selected in a slicer. | Measures, in every report that uses the model | Number or date |
| DAX formatting | Use a DAX function such as FORMAT in a measure or calculated column. | Wherever you use the measure or column | Text |
Model format strings and dynamic format strings don't change the value. The model returns the number or date along with its format string, and the visual applies the format string to display it. The value still sorts, aggregates, and plots as a number or date.
DAX formatting changes the value. The model returns text that's already formatted, and the visual displays the text as is. Because the result is text, charts can't plot it and it sorts alphabetically.
DAX formatting is useful when you want to join values with text in a specific format, such as in dynamic titles and subtitles or tooltips. For example, "Sales as of " & FORMAT(MAX('Date'[Date]), "mmmm d, yyyy") returns Sales as of September 4, 2025. It's also the only way to display formats that format strings don't support, such as quarters.
The FORMAT function also accepts an optional locale, such as FORMAT([Sales], "#,##0.00", "de-DE"). The locale controls separators and month and day names, so the result displays the same way for every viewer.
You can also use FORMAT inside a dynamic format string expression. The measure then keeps its numeric data type, and FORMAT only builds the format string. For an example, see Dynamic format strings for duration measures.
In the report
| Option | How you set it | Applies to |
|---|---|---|
| Visual format string | In the Format pane, go to General > Data format. | A column, measure, or visual calculation in one visual |
| Visual element format string | In the Format pane, set Display units to Custom for a visual element, such as data labels or a new card callout value. Then enter a format code, or use conditional formatting to get the format string from a field. | One visual element |
| Display units | Set Display units in the Format pane to scale values with a built-in unit, define a custom unit such as thousand, or turn scaling off. You can also turn on Default display units to 'none' for the report. | A visual, a visual element, or the whole report |
| Format string locale | Select a locale in the report's regional settings. | All locale-aware formats in the report |
| Text box dynamic value formatting | In a text box, use the formatting options in the flyout where you select the field from the semantic model. | One dynamic value in a text box |
Visual calculations aren't part of the model, so you can format them only with a visual or visual element format string.
Dynamic values in text boxes have their own, more limited formatting options. When you select a field from the semantic model to add to a text box, the flyout offers only simple formatting. You can't set display units or enter a custom format string. To display a dynamic value in another format, set a model format string or dynamic format string on the measure, or use DAX formatting.
Which option takes precedence
When more than one format string applies to a value, the most specific one wins:
- Visual element format string
- Visual format string
- Model format string or dynamic format string
Display units apply on top of whichever format string wins. For example, if Display units is set to Auto, a value formatted as #,##0 can still display as 12K.
VBA and .NET format string syntax
Power BI formats values in two places, and each place uses a different format string syntax.
| Where the value is formatted | Syntax | Applies to |
|---|---|---|
| In the visual. The visual receives a number or date and applies the format string. | .NET, with Power BI extensions | Model format strings, including the Format dropdown and Custom format strings in Report view and Model view, dynamic format strings, and formatString in TMDL. Also visual and visual element format strings. |
| In the semantic model. DAX formats the value and returns it as text. | Visual Basic for Applications (VBA) | DAX formatting, such as the FORMAT function. |
Visuals use .NET format strings that Power BI extends to accept common VBA-style tokens, such as lowercase m for month and n for minutes. For the tokens that visuals support, see Use custom format strings in Power BI Desktop. For the full syntax that DAX formatting supports, see the FORMAT function.
Common numeric and date format strings, such as #,##0.00 and mmm d, yyyy, work the same way in both. Use lowercase m for month in both. DAX formatting also supports tokens that visuals don't, such as quarters:
| Unit | Visual (.NET with extensions) | DAX formatting (VBA) |
|---|---|---|
| Month | m, mm, mmm, mmmm |
m, mm, mmm, mmmm |
| Quarter | Not available | q |
Note
Quarter formatting is available only with DAX formatting, such as the FORMAT function. For example, FORMAT([Date], "yyyy \Qq") returns 2025 Q3. You can't display the quarter by using a model, visual, or visual element format string.