Export (0) Print
Expand All

Parameters for DAX Queries

This topic illustrates how to pass parameter values in an XMLA structure to a DAX query statement.

A well-defined DAX query statement can be parameterized and then used over and over with just changes in the parameter values.

The Execute Method (XMLA) method in XMLA has a Parameters Element (XMLA) collection element that allows parameters to be defined and assigned a value; within the collection, each Parameter Element (XMLA) element defines the name of the parameter and a value to it.

The DAX query syntax allows you to reference XMLA parameters by prefixing the name of the parameter with an @ character. Hence, any place in the syntax where a value is allowed it can be replaced with a parameter call. Keep in-mind all XMLA parameters are typed as text.

Caution note Caution

Parameters defined in the parameters section and not used in the <STATEMENT> element generate an error response in XMLA.

Caution note Caution

Parameters used and not defined in the <Parameters> element generate an error response in XMLA.

Community Additions

ADD
Show:
© 2014 Microsoft