Forum Discussion
charleshale
Continued Contributor
3 years agoResources for basic Dax Group By Concatenating Values
Does anyone have any resources or guides for how to achieve the equivalent to M Query's Group By in DAX with turning a secondary column into a list of values? I'm not seeing how to do that in guide...
- 3 years ago
you can try something like:
Table = ADDCOLUMNS(VALUES([email]), "Accessed From", CONCATENATEX(Table, [Accessed From], "|")) - 3 years ago
As a calculated table:
Table2 = SUMMARIZE ( 'Table', 'Table'[Email], "Accessed From", CONCATENATEX ( VALUES ( 'Table'[Accessed From] ), 'Table'[Accessed From], " | " ) ) - 3 years ago
Update - this code fixed the problem
a_usacities_sum =ADDCOLUMNS(DISTINCT(SUMMARIZE(a_uscities, a_uscities[city], a_uscities[Count Dupes])),"States",VAR _city = a_uscities[city]RETURNCALCULATE(CONCATENATEX(VALUES ( 'a_uscities'[state_id] ),'a_uscities'[state_id]," | "),a_uscities[city] = _city))
charleshale
Continued Contributor
3 years agoUh oh. I am actually losing row context trying this with a geo table where I am trying to take the 107,000 incorporated towns in the US and concatenatex the names of the states where there are dupes
a_usacities_sum =
ADDCOLUMNS(
DISTINCT(SUMMARIZE(a_uscities,
a_uscities[city], a_uscities[Count Dupes])),
"States", CONCATENATEX(VALUES ( 'a_uscities'[state_id] ),
'a_uscities'[state_id],
" | "
))The above is missing row context
Going to try some some filter code changes