Forum Discussion

prashantg364's avatar
prashantg364
Icon for Helper II rankHelper II
3 years ago
Solved

DAX column

I am having data as per the below input table.

Now I want to create a new column where if the cluster name is the same then I want to concatenate the band else result in band available in the existing column. refer output table to understand my requirement.

pls help


input table

 

CircleClusterBand17_KPIs
BRBR-ARRH-000170012
BRBR-ARRH-0001350010
BRBR-ARRH-000270015
BRBR-BGLP-0003350010
BRBR-BGLP-000470015
BRBR-BGLP-0004350016

 

 

Output table

 

CircleClusterBand17_KPIsNew column
BRBR-ARRH-000170012700
BRBR-ARRH-0001350010700,3500
BRBR-ARRH-000270015700,3500
BRBR-BGLP-00033500103500
BRBR-BGLP-000470015700,3500
BRBR-BGLP-0004350016700,3500
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi prashantg364 ,

     

    I suggest you to try code as below to create a calculated column.

    New column = CONCATENATEX(FILTER('Table','Table'[Cluster] = EARLIER('Table'[Cluster])),'Table'[Band],",")

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • There is no sort oder in Power BI. How are you identifying the "first" entry per cluster?  or should all rows in your expected result say 700,3500 ?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi prashantg364 ,

     

    I suggest you to try code as below to create a calculated column.

    New column = CONCATENATEX(FILTER('Table','Table'[Cluster] = EARLIER('Table'[Cluster])),'Table'[Band],",")

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.