Forum Discussion
concatenate multiple columns null value, remove commas, DAX
- 2 years ago
Hi anonymous111
This is easier to resolve from PQ .
You need just 3 steps :1. Merge columns:
2. replace
'' with '3. extract text from the first comma:
extract the the text before last comma
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- 2 years ago
Hi anonymous111
You can use this DAX:merged =varconcantenated = [Column1]&","&[Column2]&","&[Column3]&","&[Column4]&","&[Column5]&","&[Column6]varreplace_caommas=SUBSTITUTE(concantenated,",,",",")varreplace_caommas_repeat=SUBSTITUTE(replace_caommas,",,",",")varremove_comma_first_Char =if(LEFT(replace_caommas_repeat,1)=",",REPLACE(replace_caommas_repeat,1,1,""),replace_caommas_repeat)RETURNremove_comma_first_CharThe updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Hi anonymous111
This is easier to resolve from PQ .
You need just 3 steps :
1. Merge columns:
2. replace
'' with '
3. extract text from the first comma:
extract the the text before last comma
pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Thank you for the screenshot, but data source I am working on, it doesn't allow me to access pq.
- Ritaf19832 years agoSuper User
Hi anonymous111
You can use this DAX:merged =varconcantenated = [Column1]&","&[Column2]&","&[Column3]&","&[Column4]&","&[Column5]&","&[Column6]varreplace_caommas=SUBSTITUTE(concantenated,",,",",")varreplace_caommas_repeat=SUBSTITUTE(replace_caommas,",,",",")varremove_comma_first_Char =if(LEFT(replace_caommas_repeat,1)=",",REPLACE(replace_caommas_repeat,1,1,""),replace_caommas_repeat)RETURNremove_comma_first_CharThe updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- anonymous1112 years agoFrequent Visitor
Didn't work-doesn't show any error as well; no changes, is it something to do with string function? trimend function doesn't show up as well.