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.
|Format Type||Format String||Displayed 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|
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 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.
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".
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.
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]
Example numeric formats supported:
|Format Type||Format 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 Type||Format String||Displayed Text|
|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|
|Year||y, yy, yyyy|
|Month||M, MM, MMM, MMMM|
|Day||d, dd, ddd, dddd|
|12-hour clock||h, hh|
|24-hour clock||H, HH|
|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.
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.
Switch to View mode and check the tooltip for a data point.
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)|
3.7. Size and color rule keywords
The following keywords are supported for the legend text property of size and color rules (i.e. Range Size Rule, Auto Size Rule, Range Color Rule, and Auto Color Rule) in any visualization.
|[From]||The starting value in the range.|
|[To]||The ending value in the range.|
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).