Forum Discussion
IF function does not recognize columns
- 7 years ago
Hey Anonymous ,
I assume that the reason for this unexpected behavior is just this:
You are creating a new measure. A measure can be considered as an aggregation of a numeric value from a filtered table. For this reason the reference of a column inside a table has to be wrapped into an aggregation function like SUM(...).
On the other hand the creation of a calculated column allows to reference a column without using an aggregation function as the formula is evaluated for each row of the table. A more technical phrase will be: the formula of a calculated column will be evaluated inside the Row Context.
I guess what happened is this, you copied the DAX code from a calculated column and by accident tried to use it inside a measure definition.
Another hint, the term "calculated functions" is not common in the world of DAX, please try to discover what it is called that you are referencing to avoid confusio :-)
Hopefully this provides some additional insights.
Regards,
Tom
Hey Anonymous ,
I assume that the reason for this unexpected behavior is just this:
You are creating a new measure. A measure can be considered as an aggregation of a numeric value from a filtered table. For this reason the reference of a column inside a table has to be wrapped into an aggregation function like SUM(...).
On the other hand the creation of a calculated column allows to reference a column without using an aggregation function as the formula is evaluated for each row of the table. A more technical phrase will be: the formula of a calculated column will be evaluated inside the Row Context.
I guess what happened is this, you copied the DAX code from a calculated column and by accident tried to use it inside a measure definition.
Another hint, the term "calculated functions" is not common in the world of DAX, please try to discover what it is called that you are referencing to avoid confusio :-)
Hopefully this provides some additional insights.
Regards,
Tom