Forum Discussion
error message not sure what to do
i have this message when trying to get a value from a column
Hi, FCF
You may try the following calculated column or measure.
Calculated column:
Column = Targets[ Target Margin(CDN$) ]- CALCULATE( SUM(Sales[act_mar]), FILTER( ALL(Sales), [Week]=EARLIER(Targets[Wk #]) ) )Measure:
Measure = SELECTEDVALUE(Targets[ Target Margin(CDN$) ])- CALCULATE( SUM(Sales[act_mar]), FILTER( ALL(Sales), [Week]=SELECTEDVALUE(Targets[Wk #]) ) )Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
12 Replies
- lkalawski
Resident Rockstar
If you are creating a measure, you cannot refer to a column this way. The measure returns a single value, so you must use one of the aggregate functions (SUM, MIX, MAX etc.).
If you want to compute something at row level then add a calculated column - then you can do it just like you do now.
_______________
If I helped, please accept the solution and give kudos! 😀- FCF
Helper IV
hi
thanks for the response, i am really new to this and am not sure what you mean by creating a calculated column
- lkalawski
Resident Rockstar
If you have a table and you want to add an additional column that calculates something based on other columns in this table, then you click calculated New Column and you create a formula to calculate.
You can read more about it here: https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
_______________
If I helped, please accept the solution and give kudos! 😀