I have a Virtual Column with the following formula. What I am trying to get is the date value in the Date Column of the History table based upon the filter I set. What this function does is to return a Ref and I could use a second Virtual Column to get the date (i.e., [VC1].[Date]) but can I do this in one function, not two?
MAXROW(
“History”,
“Date”,
AND(
([Member] = [_THISROW].[Key]),
([Status] = “Started”),
([Section] = “Beginners”)
)
)
Solved! Go to Solution.
Please try in one column
MAX(SELECT(History[Date], AND([Member] = [_THISROW].[Key] , [Status] = “Started” , [Section] = “Beginners”)))
Assumes [Date] is a DATE type column.
Ah, just found this thread: New Bug Encountered: MAXROW() VC not returning a dereference value-auto generating lists in other ta...
I think this is working as intended so I need the two virtual columns unless someone knows better
Please try in one column
MAX(SELECT(History[Date], AND([Member] = [_THISROW].[Key] , [Status] = “Started” , [Section] = “Beginners”)))
Assumes [Date] is a DATE type column.
Many thanks. That works perfectly
Nice to know it works well per your requirement.
Just for further relevant discussion, I believe one column expression was possible because the requirement was to get the value of “Date” type columns. Date type column is a numeric column type and can be used with expression MAX() in addition to number type columns for example.
If the requirement was to get the value of some other say text type column with the max date and with other filter conditions remaining as it is, then I believe the two column approach - first finding key through MAXROW() and then using dereference expression to find the text type column value- would have been required.
User | Count |
---|---|
44 | |
31 | |
29 | |
14 | |
14 |