Dynamic Number Formats in Power BI

Power BI includes plenty of built-in formatting options for numbers. For many reports, choosing currency, percentage or decimal places from the formatting menu will do exactly what you need. However, sometimes you want a little more control.

You might want negative values shown in brackets, zeros displayed as a dash, large values shortened to millions, or a variance measure shown with an up or down arrow. This is where custom number formats are useful.

A custom format changes how a value is displayed without changing the underlying number. Your measure remains numeric, which means it can still be used in charts, calculations, sorting and conditional formatting.

Where Can You Apply a Dynamic Format?

In Power BI, number formats can be applied at several levels:

Level Use It When...
Model level You want a measure or column to display consistently throughout the report.
Visual level You want to override the format for one particular visual.
Element level You want to format a specific part of a supported visual, such as a data label or card value.

For reusable measures such as Total Sales, Profit Margin or Sales Variance, applying the format at model level is often the neatest option, but the Dynamic Format option in the report view offers extra flexibility.

To do this, select the measure or column in the data pane, go to the formatting options in the Properties or Measure tools pane, choose Dynamic, and enter the required format string.

The format string can be changed by selecting the measure in the data pane and using the dropdown to the left of the formula bar, and changing Measure to Format.

The Structure of a Custom Number Format

In Power BI, a custom number format can contain up to three sections, separated by semicolons:

Positive format ; Negative format ; Zero format

For example:

£#,##0;(£#,##0);-

This tells Power BI to display:

Value Displayed As
1250 £1,250
-1250 (£1,250)
0 -

This is similar to custom number formatting in Tableau.

Useful Formatting Characters

Character What It Does Example
0 Displays a digit, including required zeros. 0.0 displays 4.0
# Displays a digit only when required. #,##0 displays 1,250
, Adds a thousands separator, or scales values when placed at the end. #,##0, displays thousands
. Controls decimal places. #,##0.0 displays one decimal place
% Displays the value as a percentage. 0.0% displays 12.5%
"Text" Adds text or symbols to the displayed value. 0.0" kg" displays 4.2 kg
; Separates positive, negative and zero formats. #,##0;(#,##0);-

Some Practical Examples

Use Case Format String Example Result
Whole number with commas #,##0 12,500
Currency with negatives in brackets £#,##0;(£#,##0);- (£1,250)
Percentage with one decimal place 0.0% 12.5%
Values in thousands £#,##0.0,"K" £12.5K
Values in millions £#,##0.0,,"M" £12.5M
Values in billions £#,##0.0,,,"B" £12.5B
Positive and negative variance arrows "▲ "£#,##0;"▼ "£#,##0;"-" ▲ £1,250
Scientific notation 0.00E+00 1.25E+04

Scaling - Custom Formats vs Display Units

A comma at the end of a number format scales the displayed value by 1,000. Two commas scale it by 1,000,000, and three commas scale it by 1,000,000,000.

This means the format below displays a value in millions:

£#,##0.0,,"M"

A value of 12500000 would therefore display as £12.5M.

Power BI visuals also include a Display units option, which can automatically shorten large values to thousands, millions or billions.

For a simple card or axis, this may be all you need. However, if you create your own custom abbreviated format, such as the millions example above, it is usually best to set the visual's Display units to None. Otherwise, Power BI may apply its own automatic scaling as well as your custom format, producing unexpected results.

Custom Formats vs Conditional Formatting

A custom number format changes the way a value is written. For example, it can add an arrow to show whether a variance is positive or negative:

"▲ "£#,##0;"▼ "£#,##0;"-"

However, a custom format does not control the colour of the value. If you also want increases displayed in green and decreases displayed in red, that should be handled separately using conditional formatting.

Using a Lookup Table for Dynamic Format Strings

Dynamic Format Strings are most useful when the format needs to respond to the report context.

For example, Microsoft’s documentation (link at the end) shows a currency conversion measure where the selected country or region controls how the result is displayed. The measure calculates the converted sales amount, while the format string changes separately.

This is done using a small lookup table containing the currency format for each country or region. For example, that table might contain a column like this:

'Country/Region Currency Format Strings'[Format]

Each row in that column stores the format string that should be used for a particular country or region, such as:

£#,0
$#,0.00
¥#,0

The Dynamic Format String then uses DAX to return the correct format from the lookup table:

SELECTEDVALUE(
  'Country/Region Currency Format Strings'[Format],
  "$#,0.00;($#,0.00);$#,0.00"
)

The first part tells Power BI which column contains the possible format strings:

'Country/Region Currency Format Strings'[Format]

The second part is the fallback format:

"$#,0.00;($#,0.00);$#,0.00"

This fallback is used when Power BI cannot return one single format from the lookup table. For example, this might happen if no country is selected, or if multiple countries are selected.

The useful part is that the measure itself remains numeric. The lookup table and DAX expression only control how the value is displayed, so the measure can still be used properly in charts, calculations, sorting and conditional formatting.

Link to documentation: https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings

Author:
Holly Andersen
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2026 The Information Lab