Forum Discussion
powerpuffgurls
3 years agoRegular Visitor
Pull column from variable table in DAX/ Lookup in DAX
Hi everyone, i have created a variable tabel inside a measure and need to pull column1 value based on maxium value in column 2. However i can't seem to find a function that will pull or look up...
FreemanZ
Super User
3 years agonot sure if i fully get you.
Supposing your table like this:
| DOW |
| 1/1/2023 |
| 1/2/2023 |
| 1/2/2023 |
| 1/3/2023 |
| 1/3/2023 |
| 1/3/2023 |
then try to plot a measure like this:
Measure =
VAR _table =
ADDCOLUMNS(
VALUES(TableName[DOW]),
"Count",
CALCULATE(COUNTROWS(TableName))
)
VAR _countmax = MAXX(_table, [Count])
RETURN
MINX(
FILTER(_table, [Count] = _countmax),
[DOW]
)
it worked like: