Forum Discussion
Anonymous
4 years agoNot applicable
Calculated column with column = measure yields different result than column = hardcoded value
Hello, I would like to add calculated columns indicating if a row contains the latest or second latest value in the file_date column. This works well with the latest value, but does not with the...
v-chenwuz-msft
Community Support
4 years agoHi Anonymous ,
Measure result is depend on the filter context, by for calculate column, you can consider it has filter context also, but its context is the whole table and won't be changed.
And you can test these columns in one table.
column1 = 'measure'[updates_second_most_recent]
column2 = date(2022,2,9)
Then try this code:
is_second_last_column =
VAR _topn =
TOPN ( 2, VALUES ( 'table'[file_date] ), [file_date], DESC )
RETURN
MINX ( _topn, [file_date] )
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.