An expression column is used to create an expression which is a combination of data columns, operators and built-in functions. This expression column will act as a calculated measure that can be configured to widget like other normal numeric columns as a quantitative measure.
An expression field can be added by clicking Expression
menu in the tool bar of the data design view.
Click Add
in the Query Expressions
window to add a new expression column.
Enter a suitable name for the expression in the Name
text area. By default, it will be Expression1.
Enter the expression that you like to define in the Expression text area.
The syntax for defining a simple expression is,
{function name(}[columnname]{operator[columnname]…}
Where, content within curly braces is optional.
Some expressions for reference:
YEAR([Order Date]) – To compute year of order date.
COUNTD([EmployeeID]) – To compute distinct count of employees.
[Freight]+100 – To compute the total with 100 added to Freight.
Following built-in functions are supported in Expression Designer.
You can explore about each expressions detail here,
Select an expression column in left pane.
Click Delete
icon to remove the selected expression column.
Select an expression column in left pane that you need to update.
Edit the Name and Expression text areas, if required.
Click Save
in Query Expression window to save the modifications handled.
Saved measure expression will be shown in Measure Columns
section of ASSIGN DATA
tab like below.
Saved dimension expression will be shown in Dimension Columns
section of ASSIGN DATA
tab like below.
You can also drag and drop expression column into widgets from measure or dimension fields or both.
You can also apply filters for expression column which is used in widget. For numeric expressions, you can apply filter just like a measure filter. For string and date expressions, you can apply filter just like a dimension filter.
Blog Post - Using Calculated Fields in Your Dashboard