© Philip Seamark 2018
Philip SeamarkBeginning DAX with Power BIhttps://doi.org/10.1007/978-1-4842-3477-8_2

2. Variables

Philip Seamark1 
(1)
UPPER HUTT, New Zealand
 

This chapter looks at how you can use DAX variables to make calculations easier to understand and, in some cases, perform faster. Variables are used to store results from DAX expressions. These variables can be as simple as assigning a hardcoded value or the result of a complex DAX equation.

You can use variables in any type of DAX calculation including calculated columns, measures, and tables. Variables are not strictly typed and can represent any type of object in DAX. Variables automatically assume the type of the object being assigned. You must use a RETURN statement to close a layer ...

Get Beginning DAX with Power BI: The SQL Pro’s Guide to Better Business Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.