Formatting Text


1. Overview

This article shows you how to format text values that are displayed in data visualizations. Text formatting can be done at the metric set level or by using placeholder keywords and format strings in supported data visualization properties.

2. Metric set element format

You can format measure values appearing in a data visualization (e.g., table column) by opening the Metric Set / Data Binding Panel.

Click the measure's Edit button on the right. Locate the Format field and enter a valid .NET format string.

You can use standard numeric format strings or custom numeric format strings.

Enter a .NET format string
Enter a .NET format string

Format TypeFormat StringDisplayed Text
Numeric with 5 decimal places N5 80,487,704.17919
Currency with 2 decimal places C2 $80,487,704.18
Percent (multiplied by 100) with 0 decimal places P0 8,048,770,418%
Exponential/scientific with 2 decimal places E2 8.05E+007
Custom numeric (1 non-zero decimal place) 0,0.# 80,487,704.2
Custom numeric (thousands) #,0,K 80,488K
Custom numeric (millions with 1 decimal place) #,0,,.0M 80.5M

2.1. Conditional numeric formatting

Numeric values can be further formatted with thousands, millions, billions, or trillions units of measure according to the magnitude of the values. For example, to display a value larger than one million with an 'M' symbol following an appropriately divided value, enter 0M into the Millions Format field. The '0' is a placeholder for the corresponding number of millions.

Conditional numeric formatting options
Conditional numeric formatting options

Conditional numeric formatting applies to tooltips, table cells, data point labels, and data labels (assuming visualization properties have not been changed to override the formatting from the metric set). These formatting settings are not applicable to chart axes or gauge scales. Gauge scales have their own specific properties for conditional numeric formatting.

If the Format Large Values Separately option is checked, numeric values can be formatted into the different units as values vary in magnitude. When this option is unchecked, the numeric values will all use the same unit to allow for better comparison. In this case, the smallest common unit will be used. 

Values are formatted using common unit of thousands
Values are formatted using common unit of thousands

2.2. Formatting unknown values

The value displayed for unknown values can be customised to a text value. When configuring measures, the dialogue entry is Empty Value Text. The default value is blank. When configuring hierarchy Members, it is Unknown Member Caption, the default value is "Unknown".

Changing the Unknown value text to custom value
Changing the Unknown value text to custom value

3. Placeholder keywords

3.1. Measure and hierarchy keywords

Various text and tooltip properties of data visualizations accept placeholder keywords which dynamically resolve into corresponding measure or hierarchy values, with optional control over the formatting.

For example, the figure below shows the use of a placeholder keyword to display a LineTotal measure value atop each data point, where each value is formatted using the "N0" format string.

Using a placeholder keyword in a Text property for data label settings
Using a placeholder keyword in a Text property for data label settings

The keyword consists of square brackets enclosing the name of a measure or hierarchy plus an optional format string which is preceded by a colon. An example keyword for a measure: [LineTotal:N0]

Placeholder keywords support most standard date and time format strings, custom date and time format strings, and standard numeric format strings. Custom numeric format strings are not supported.

Example numeric formats supported:

Format TypeFormat String
Numeric with 2 decimal places N2
Currency with no decimal places C0
Percent (multiplied by 100) with 1 decimal place P1
Whole numbers, 3 digits D3

Example date and time formats supported:

Format TypeFormat StringDisplayed Text
Short date d Jun/12/2015
Long date D Friday, June 5, 2015
Short time t 8:31 AM
Long time T 8:31:05 AM
Long date, short time f Friday, June 5, 2015 8:31 AM
Long date, long time F Friday, June 5, 2015 8:31:05 AM
Month/day M June 05
Month/year Y 2015 June
Year  y, yy, yyyy  
Month M, MM, MMM, MMMM  
Day d, dd, ddd, dddd  
12-hour clock h, hh  
24-hour clock H, HH  
Minutes m, mm  
Seconds s, ss   
AM/PM t, tt  
Fractional seconds  f, ff, fff  

3.2. Chart keywords

The following chart-specific keywords are supported for any data point series label text, tooltip text, or legend text properties.

[Total] In any stacked chart type series, display the stacked total up to and including that data point (this technically includes Pie charts, where each segment stacks angularly from the start angle around the circle).
[Percent] In any 100% stacked chart type series, including Pie charts, display the percent of the data point out of its stack total.

3.3. Table keywords

Table visualizations accept hierarchy keywords (e.g., [Product]) in the header text for a column where the hierarchy is a column hierarchy.

3.4. Treemap keywords

Treemap-specific keywords are supported in all label text and tooltip text properties. See Using a treemap for more details.

3.5. Hierarchy Level keyword

By default, a tooltip for a chart series data point shows the hierarchy caption (e.g., Product) and corresponding member caption (e.g., Road Bikes).

If you want to display the caption of the hierarchy level instead of the hierarchy, go to the properties for the chart series. In the Tooltip Text property, construct a keyword by appending ' Level' to the name of the hierarchy like this: [<name of your hierarchy> Level]

For example, use the keyword [Product Level] to display the caption of a Product hierarchy level, or [Date Level] to display the caption of a Date hierarchy level.

Using the Level keyword
Using the Level keyword

Switch to View mode and check the tooltip for a data point.

Tooltip displays the hierarchy level (Product Subcategory)
Tooltip displays the hierarchy level (Product Subcategory)

The Level keyword can also be used with tables, maps, diagrams, gauges, data labels, and data images.

3.6. Dynamic Element keywords

The following keywords are used in the tooltip text properties of a chart series or table column when using a Dynamic Element filter.

[Dynamic Measure Caption] The caption of the current dynamic measure (e.g., OrderQty or Line Total).
[Dynamic Measure] The numerical value of the current dynamic measure.
[Dynamic Hierarchy Level] The caption of the current dynamic hierarchy level (e.g., Product Subcategory)
[Dynamic Hierarchy] The caption of the current dynamic hierarchy level member (e.g., Bib-Shorts)

4. Format properties

Dedicated format properties in data visualizations (such as on chart axes and gauge scale label styles) support the exact same format strings as measure/hierarchy keywords (and have the same restrictions).

Using a date/time format string for an axis label Format property
Using a date/time format string for an axis label Format property

5. See also

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri