Forum Discussion
Change column based on measure value
- 4 years ago
Hi Anonymous ,
You cannot create column "C" based on your measure's value.
Calculated columns are only calculated when you first define them and during a dataset refresh, it will not change by filters, it is a definite value, if you expect the value changes with filter, you can only use a measure.
In a measure, columns cannot be referenced directly, MAX function in a measure can return the current value in the same row of the column.
You can learn more about measures and calculated column in this article: calculated-measures-vs-calculated-columns
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , In DAX measure you need to have aggregation
CreatedCol = IF([Measure] = TRUE(), Max(TABLE_2[A]), max(TABLE_2[B]))
or
CreatedCol = IF([Measure] = TRUE(), sum(TABLE_2[A]), sum(TABLE_2[B]))
Also , you can not use measure in a column
Dear amitchandak,
thank you for your answer!
So as I understand if "TABLE_2[A]" and "TABLE_2[B]" are string columns, it is not possible to create column "C" based on my measure's value?
- v-yanjiang-msft4 years agoCommunity Support
Hi Anonymous ,
You cannot create column "C" based on your measure's value.
Calculated columns are only calculated when you first define them and during a dataset refresh, it will not change by filters, it is a definite value, if you expect the value changes with filter, you can only use a measure.
In a measure, columns cannot be referenced directly, MAX function in a measure can return the current value in the same row of the column.
You can learn more about measures and calculated column in this article: calculated-measures-vs-calculated-columns
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.