Axes in Expressions


When creating custom expressions, you may need to refer to an axis from the visualization in the expression. Below is a list of the available axes for different visualization types. Some of the axes can be useful in OVER expressions, whereas others are only used when defining rules or reference lines.

The term axis, in this context, does not only refer to the X and Y axes, but is a general term for the mapping of data to a dimension represented in the visualization: coloring is controlled by the Color axis, marker shape by the Shape axis and so on.

The syntax when referring to axes in an expression is [Axis.Axis Name]. For example, if the Axis Name is "X", the expression should refer to [Axis.X]. Note that the actual names to use may be different in two similar looking visualizations. For example, in the cross table you would refer to Axis.Columns whereas in a heat map you would use Axis.X for similarly set up visualizations.

It does not make any sense to include the axis you are creating the expression for in an OVER expression. Instead, you would probably want to use the categorization on the X-axis or the Color axis when defining an OVER expression on the Y-axis.

Axes to use in OVER expressions and other expressions:

Visualization

Axis (Property)

Axis Name Used in Expression

Cross table

Columns

Rows

Columns

Rows

Sparkline

Rows

X-axis

Rows*

X

Calculated value

Rows

Rows*

Icon

Rows

Rows*

Bullet graph

Rows

Rows*

Bar chart

Category axis

Color by

X

Color

Line chart

X-axis

Color by

Line by

X

Color

Line

Combination chart

X-axis

Color

X

Color

Pie chart

Color by

Color

Scatter plot

X-axis

Y-axis

Color by

Marker by

Shape by

Label by

Line by

X

Y

Color

Marker

Shape

Label

Line

3D scatter plot

X-axis

Y-axis

Z-axis

Color by

Marker by

Shape by

Label by

X

Y

Z

Color

Marker

Shape

Label

KPI chart

Axis.Tile

Axis.X

Tile by

X-axis

Map chart – Feature layer

Color by

Geometry by

Color

Geometry

Map chart - Marker layer

X-axis

Y-axis

Color by

Marker by

Shape by

Label by

Line by

X

Y

Color

Marker

Shape

Label

Line

Treemap

Hierarchy

Hierarchy

Heat map

X-axis

Y-axis

X

Y

Parallel coordinate plot

Line by

Color by

Line

Color

Waterfall chart

Axis.Color

Axis.X

Color by

Category axis

Trellis

Columns

Rows

Pages

Panels

Columns

Rows

Pages

Panels

* The Rows axis in a graphical table can be used in OVER expressions in dynamic item columns included in that graphical table.

Example:

Sum([Sales]) OVER (AllPrevious([Axis.X]))

See OVER in Custom Expressions and Advanced Custom Expressions for more information about OVER expressions.

Axes to use in rules and reference lines only:

When defining rules (for example, for coloring, icons or calculated values) or when setting up a reference line in a visualization, you will define an expression directly using the value on that very axis. (The way to refer to the axes is slightly different in those two contexts.)

Visualization

Axis (Property)

Axis Name Used in Expression

Sparkline

Y-axis

Y

Calculated value

Value

Value

Icon

Icon

Icon

Bar chart

Value axis

Y

Scatter plot

X-axis

Y-axis

X

Y

Line chart

Y-axis

Y

Combination chart

Y-axis

Y

Waterfall chart

Y-axis

Y

Examples in rules:

[Axis.Color]="West"

[Axis.Value]> 10000

Example in reference line:

Avg([Y])*10

See also:

Custom Expressions Introduction

Custom Expressions Overview

Visualization Properties in Expressions