Forum Discussion
Concatenate text by group : EARLIER function not working
- 2 years ago
If you are writing a measure, it will be a bit simpler than the code shown.
Follow the example here https://learn.microsoft.com/en-us/dax/concatenatex-function-dax?WT.mc_id=DP-MVP-4025372#example
- Anonymous2 years ago
Hi Anonymous ,
JamesFR06 Good solution.
Here's what I need to add
According to mine using your data to test the dax you wrote in power bi, when I put your dax code into measure, he got the same error as you. But when you use the calculated columns, your dax code runs with the results you want. According to the documentation I checked, EARLIER succeeds if there is a row context prior to the beginning of the table scan. otherwise it returns an error.Also, you can create a new table
Table = ADDCOLUMNS( SUMMARIZE('SPN', 'SPN'[Group Registration ID]), "Codes", CONCATENATEX( FILTER('SPN', 'SPN'[Group Registration ID] = EARLIER('SPN'[Group Registration ID])), 'SPN'[SPN CODE], "; " ) )Final output
EARLIER function (DAX) - DAX | Microsoft LearnBest regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Please find the measure :