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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
aishaakhter18
Helper I
Helper I

Merge of comma separated Data of two cells

Hi 
I have two cells  "Countries with Insights" & "Countries Awareness" , I am using below DAX to merge is into one col so I can get a correct count of countries 
 
2 Col Countries = CONCATENATE([Countries with Insights] , [Countries Awareness])
 
But I am getting this output= United StatesUnited States instead of United States, United States, and because of this it coount it 1 insteat 2 - How should I fix it 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @aishaakhter18 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1707103115983.png

(2)Click on "transform data" to enter the power query editor, select the three columns and right click on "unpivot columns".

vtangjiemsft_1-1707103214857.pngvtangjiemsft_2-1707103227111.png

(3) Click "Close and Apply" and then we can create a measure.

Measure = CALCULATE( COUNTA('Table'[Value]),'Table'[Value]<>BLANK())

(4) Then the result is as follows.

vtangjiemsft_3-1707103761340.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @aishaakhter18 ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1707103115983.png

(2)Click on "transform data" to enter the power query editor, select the three columns and right click on "unpivot columns".

vtangjiemsft_1-1707103214857.pngvtangjiemsft_2-1707103227111.png

(3) Click "Close and Apply" and then we can create a measure.

Measure = CALCULATE( COUNTA('Table'[Value]),'Table'[Value]<>BLANK())

(4) Then the result is as follows.

vtangjiemsft_3-1707103761340.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

aj1973
Community Champion
Community Champion

Hi @aishaakhter18 

you don't need to merge the 2 columns if it is only for counting Rows where Country = USA.

Just create a measure that COUNTROWS where [Countries with Insights] = "United States" and another COUNTROWS where [Countries Awareness] = "United States". Then do the SUM of both measures.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Ok got it guess, but I have three col with various countries names,and some of them have like 24 countries seperated by comma  in various rows that  the reaosn I was merging them and then counting, the method you are telling me i need to creat three seperate col, then get sum of then  in one more col, so total 4 new cols, but I will try and see thanks 

 

It sounds like you need to use Power Query to do some cleaning and transformation.

Anyway let me know.

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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