Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to concatenate text by Group in DAX, EARLIER function not working

Tags:

powerbi

dax

I am trying to create a measure in DAX to concatenate all CODES that have the same Group ID.

I have tried the CONCATENATEX function mentioned in many other discussion threads but it doesn't seem to function as there appears to be a problem with the function EARLIER which doesn't recognize any value.

This is the initial table:

enter image description here

The desired output should be as such:

enter image description here

I have tried this but it's not working:

CODES = CONCATENATEX(FILTER(SPN, SPN[Group Registration ID]=EARLIER(SPN[Group Registration ID])), SPN[SPN CODE], "; ")

I would appreciate any orientation

Thank you

like image 579
Ahmed Walid Moulahoum Avatar asked Dec 22 '25 02:12

Ahmed Walid Moulahoum


1 Answers

This should do it.

Codes = --The purpose of this measure is concat the codes associated with the reg. id
IF(
 ISFILTERED('table'[Group Registration ID])=TRUE(),
  CONCATENATEX(VALUES('table'[SPN CODE]), 'table'[SPN CODE], ", "))
like image 177
zach Avatar answered Dec 26 '25 12:12

zach



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!