Forum Discussion
MISSING FIELDS
- 10 years ago
You're referring to the [EURO_VALUE] column in a measure. This means there's no context in which to determine which row's value of [EURO_VALUE] should be returned. A measure must return a scalar - this means that the evaluation of the function(s) therein must return a scalar value. [EURO_VALUE] is an entire column. A column is many separate values.
Wrapping your column in an aggregate function will make the measure functional, e.g.:
Total Euro Value = SUM( 'ShipmentCost'[EURO_VALUE] )
As a note for you, it is considered a best practice to always use fully qualified column references: '<table name>'[<field name>], and unqualified measure references: [<measure>].
When you are adding a calculated column, that column definition is evaluated in a row context based on its parent table. In a row context, a column reference makes sense, because a column has only one distinct value in a given row context, so its value is scalar.
You're referring to the [EURO_VALUE] column in a measure. This means there's no context in which to determine which row's value of [EURO_VALUE] should be returned. A measure must return a scalar - this means that the evaluation of the function(s) therein must return a scalar value. [EURO_VALUE] is an entire column. A column is many separate values.
Wrapping your column in an aggregate function will make the measure functional, e.g.:
Total Euro Value = SUM( 'ShipmentCost'[EURO_VALUE] )
As a note for you, it is considered a best practice to always use fully qualified column references: '<table name>'[<field name>], and unqualified measure references: [<measure>].
When you are adding a calculated column, that column definition is evaluated in a row context based on its parent table. In a row context, a column reference makes sense, because a column has only one distinct value in a given row context, so its value is scalar.
thank you for this clear answer and tip regarding naming conventions. This indeed solved my issue.
- greggyb10 years agoResident Rockstar
The Intellisense in the DAX editor has gotten a good amount of work, and I find that it keeps up with me even in very complex measures. If what you're writing doesn't have an auto-complete option, it's quite likely that it is not valid DAX.
Any error you see, though, like the one in your screenshot, are not generated by the Intellisense engine, but the Tabular model in the .pbix file itself. If you see an error after finishing a measure or a column definition, that means that the statement truly is invalid and could never return data as written.