Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Saxon10
Post Prodigy
Post Prodigy

CONCATENATEX unique value

Hi

 

I have a two tables are Data and Report, both tables contain the same headers are “Item” and “Comments”.

 

DATA

 

In data table the item columns contains prefix only and the same item contain multiple comments.

 

ITEMCOMMENTS
45 
45 
123456DMKRETURN
123456DMKRETURN
2345678ADMKNON-RETURN
2345678ADMKNON-RETURN
2345678ADMK 
2345678ADMK 
12345TRRETURN
12345TRNON-RETURN
12345TR 

 

REPORT

 

In report table the item columns contain prefix and suffix. The unique key is prefix for both tables in order to match tables from “Data” to “Report”. I would like to bring it the unique comments from Data table into the Report Table.

 

ITEMCOMMENTS
44NA
45 
123456DMKRETURN
123456DMK-001RETURN
123456DMK-002RETURN
123456DMK-001DMKRETURN
2345678ADMKNON RETURN
2345678ADMK-BJPNON RETURN
2345678ADMK-0123NON RETURN
2345678ADMK-234MENON RETURN
2345678ADMK-DMKNON RETURN
12345TRRETURN|-|NON-RETURN
12345TR-001RETURN|-|NON-RETURN
12345TR-002RETURN|-|NON-RETURN
12345TR-003RETURN|-|NON-RETURN
12345TR-004RETURN|-|NON-RETURN
12345TR-005RETURN|-|NON-RETURN

 

 

DESIRED RESULT

 

  1. In Data table the same item contain two different comments in this scenario I would like to get the both comments in the same cell without duplication.
  2. In Data table the same item contain repeated comments also banks as well in this scenario I would like to get the comments in the same cell without repetition.
  3. In Report table the item can’t found in data table then return “NA” and if it’s blanks and return blanks.

DATA

 

DATA.PNG

REPORT:

REPORT.PNG

DESIRED RESULT:

RESULT.PNG

 

 

6 REPLIES 6
MFelix
Super User
Super User

Hi @Saxon10 ,

 

I have created a table with the SUFIX and a column on the report also with the sufix then made the following setup:

MFelix_0-1609840101608.png

 

Now add the following measure:

Comments Values = 
COALESCE (
    CALCULATE (
        CONCATENATEX ( VALUES ( DATA[Comments] ); DATA[Comments]; "|-|" );
        CROSSFILTER ( REPORT[SUFIX]; SUFIX[SUFIX]; BOTH )
    );
    "NA"
)

 

Result below and in attach PBIX file:

 

 
 

comments.png


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi,

 

Thanks for your reply.

 

I would like to achieve my result by New calculate column. can you please advise.  

Don't @Saxon10,

Use exactly the same bnut formula in a calculated column:

MFelix_0-1609847614826.png


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you so much for your response and help. 

Your solution working well but when I try to follow-up the same logic then I receiving the following error message "CROSSFILTER function can only use the two column references participating in a relationship". Can please advise what is the reaon I am getting error?

 The Data table keep changing on a daily basis so it’s very hard and difficult to make a unique item and import the data every day in Power BI. 

I am happy to create new calculated columns within the tables or new table instead of import the data.

Can you please provide alternative solution if it possible? I would like to achieve my final desired result by using calculated column.  

Hi , @Saxon10 
This error message "CROSSFILTER function can only use the two column references participating in a relationship"  usually caused by the incorrect relationship between the tables.

Please ensure that the two parameter fields in  CROSSFILTER  function have the correct relationship.

 

Best Regards,
Community Support Team _ Eason

Saxon10
Post Prodigy
Post Prodigy

I created helper column for item in report table (Keep only prefix-item1) and I apply the following calulated column 

CONCATENATEX(FILTER(ALL(DATA),DATA[ITEM]=EARLIER(REPORT[ITEM1])),DATA[COMMENTS]),"||") but it will bring it duplicated comments.
 
I would like to achieve my desired result without duplication columns.
 
Any advise please.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors