Forum Discussion
Lag Column based on different loops and sorting
- 4 years ago
NaderSaeed , Try a new column like
New column =
var _max = maxx(filter(Table, [Unit] = earlier( [Unit]) && [Date] < earlier([Date]) && [Parameter] = earlier([Parameter]) ), [Date])
return
maxx(filter(Table, [Unit] = earlier( [Unit]) && [Date] =_max && [Parameter] = earlier([Parameter]) ), [Value])
NaderSaeed , Try a new column like
New column =
var _max = maxx(filter(Table, [Unit] = earlier( [Unit]) && [Date] < earlier([Date]) && [Parameter] = earlier([Parameter]) ), [Date])
return
maxx(filter(Table, [Unit] = earlier( [Unit]) && [Date] =_max && [Parameter] = earlier([Parameter]) ), [Value])
- amitchandak4 years ago
Super User
NaderSaeed , Please use correct table name, In power BI if the table name is tbale it is usually in single quote
'Table'
Also, check if your table name is the same
New column =
var _max = maxx(filter('Table', [Unit] = earlier( [Unit]) && [Date] < earlier([Date]) && [Parameter] = earlier([Parameter]) ), [Date])
return
maxx(filter('Table', [Unit] = earlier( [Unit]) && [Date] =_max && [Parameter] = earlier([Parameter]) ), [Value])