How to use a MySQL Query result as a variable in DisplayName

You can then uae dynamic query.

Or try group by matrix transfornation