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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
burrito
Helper I
Helper I

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

@burrito , 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
Resolver I
Resolver I

Hii @burrito 

Can you please provide the snapshot of the required output?

bhanu_gautam
Super User
Super User

@burrito , 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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