I worked out a similar solution with another member a few months ago. It’s definitely trickier than it seems at first glance, because you have to apply all the context within the measure, and then get it to generate the vertical list. The trick is to use CONCATENATEX() with UNICHAR(10) as the delimiter (UNICHAR(10) = hard return).
Clubs Visited List =
CALCULATE(
CONCATENATEX(
VALUES('Sales Data'[Club Code]),
'Sales Data'[Club Code],
UNICHAR(10),
'Sales Data'[Club Code],
ASC
),
FILTER(
'Sales Data',
[Visited] = 1
),
VALUES( 'Members'[Member Code] )
)
I’ve attached the full solution file, which should make it relatively straightforward to adapt this measure to your specific data.
Hope this is helpful. If you have any problems, please just post your PBIX and we can work through a more specific solution.
- Brian
eDNA Forum -Return List in DAX - solution.pbix (1.3 MB)