Forum Discussion

abimfol's avatar
abimfol
New Member
4 years ago

Select text value from a variable table - DAX

VAR _vGetMax = CALCULATETABLE(
SUMMARIZECOLUMNS(

Mytable[brand],
mytable[groups],
'Perfect Experience - Charts'[Sort],
"@prodcount", [Prod Count]),
DATESBETWEEN('Calendar Table'[Date], DATEADD(LASTDATE('Calendar Table'[Date]), -2,MONTH),
LASTDATE('Calendar Table'[Date])))

VAR _maxprodcount =
MAXX ( _vGetMax , [@prodcount] )

I do have a variable table that is derived using the above if i return the variable _maxprodcount it gives me the highest product count as desired. Now the challenge is i want to slect the brand where [@prodcount] = _maxprodcount

Can anyone help with this?

Many thanks

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  abimfol ,

    So far, the created virtual table cannot be used for filtering. You can try to create the virtual table in the formula as a physical table, and then filter

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.