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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
Anonymous
Not applicable

Need help in removing succeeding commas in a cell.

Hello, I have below table and want to transform Column A to Column B with below output.

burrito_0-1721814972802.png

 

Basically, I want to remove all succeeding commas. I can do this in transform data however Column A is calculated in DAX and it's not present yet in transform data so I need a DAX to remove the succeeding commas.

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Anonymous , Use the below DAX

 


Column B =
VAR SplitString = SUBSTITUTE([Column A], ",", "|")
VAR StringTable = ADDCOLUMNS(
GENERATESERIES(1, LEN(SplitString) - LEN(SUBSTITUTE(SplitString, "|", "")) + 1),
"Element", PATHITEM(SplitString, [Value], TEXT)
)
VAR FilteredTable = FILTER(StringTable, [Element] <> "")
RETURN CONCATENATEX(FilteredTable, [Element], ",")




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
Khushidesai0109
Continued Contributor
Continued Contributor

Hii @Anonymous 

Can you please provide the snapshot of the required output?

bhanu_gautam
Super User
Super User

@Anonymous , Use the below DAX

 


Column B =
VAR SplitString = SUBSTITUTE([Column A], ",", "|")
VAR StringTable = ADDCOLUMNS(
GENERATESERIES(1, LEN(SplitString) - LEN(SUBSTITUTE(SplitString, "|", "")) + 1),
"Element", PATHITEM(SplitString, [Value], TEXT)
)
VAR FilteredTable = FILTER(StringTable, [Element] <> "")
RETURN CONCATENATEX(FilteredTable, [Element], ",")




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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