Forum Discussion
Why does my VAR function return other values for newly created columns?
- 1 year ago
pls try this and add the similar coding in red in your original DAX.
Column =VAR _last=maxx(FILTER('Table','Table'[number]=EARLIER('Table'[number])&&'Table'[entry time]<EARLIER('Table'[entry time])),'Table'[entry time])return if (ISBLANK(_last),'Table'[entry time],_last)
it looks like your DAX is correct. Have you tried sort by the entry time column to see if there is the time which is 11:04:28?
Oh thank you,My original sheet looked like this.
I found a time of 11:04:28
But I find that it shouldn't be calculated that way.
The VAR function calculation just mentioned should be performed only when the green module “number” column is the same.
Otherwise it will match the time of the other “number”.
How can I change the previous function?
- ryan_mayu1 year ago
Super User
pls try this and add the similar coding in red in your original DAX.
Column =VAR _last=maxx(FILTER('Table','Table'[number]=EARLIER('Table'[number])&&'Table'[entry time]<EARLIER('Table'[entry time])),'Table'[entry time])return if (ISBLANK(_last),'Table'[entry time],_last) - Yumikang1 year ago
Helper II
Dear all,
I need help,Why does my VAR function return other values for newly created columns?
I would like to create new columns about entry times as shown in the green box.
Find the latest entry time before the current line, if this time and the entry time difference of 2min, then return to the earlier one; if the difference is more than 2min and there is no earlier time, then return to the entry time of the current line.
But why is it that there in the red box, I'm returning a new never-before-seen time?