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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Removing semicolon from beginning of cells

Hi all,

 

I ran into an interesting issue cleaning up some data and I'm still new at Power BI so I'd appreciate any help you can give me! I've included a snippet of the column I'm trying to clean up. I just want to remove the semicolon that comes first in some cells but leave the other semicolons that are separating other values (the semicolons in red).  There aren't any particular letters that always have a semicolon before them and sometimes there is a space and sometimes there is not a space. Any ideas on how to remove just these ones? If I didn't have 50,000 observations I'd be tempted to just manually find and replace these. Thanks everyone!

 

; M5441
; M5441
; M5441
J040; J069; B9789;
J040; J069; B9789;
J040; J069; B9789;
S61211A;
S61211A;
S61211A;
S61211A;
S61211A;
S61211A;
S61211A;
; L02219; L03319
; L02219; L03319
; L02219; L03319
;K029
F458;F259; K5900
F458;F259; K5900
F458;F259; K5900
F458;F259; K5900
 
I509; R079
; H9203; J4521; J069; B9789
; H9203; J4521; J069; B9789
; H9203; J4521; J069; B9789
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Anonymous you can add custom column in power query with following expression, change col in following expression with your column name

 

if Text.StartsWith([Col],";") then Text.AfterDelimiter([Col],";") else [Col]


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@Anonymous you can add custom column in power query with following expression, change col in following expression with your column name

 

if Text.StartsWith([Col],";") then Text.AfterDelimiter([Col],";") else [Col]


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Wow, I made that way more complicated in my head! Thank you so much!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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