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
Alexjaco2
New Member

Removing 3 digit numbers from a list

Hi All, 

I have a list of numbers (stored as texts) that are semi colon sepearated and I need specific 3 digit values removed. Is there any Power Query that can do this? Here is what I have and what I need. 

HaveWant
9083290832
9921399213
9921399213
9921399213
9921499214
9921499214
636 90750 ; 771 9047190750 ; 90471
9921399213
9921499214
914 9079190791
9921499214
636 90674 ; 771 9047190674 ; 90471
9921499214
9921499214
301 80050 ; 301 80061 ; 301 82607 ; 780 Q301480050 ; 80061 ; 82607 ; Q3014
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Alexjaco2 Maybe this?

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fc2xDYAwDATAVazUFO/Y2ImYgjrK/mvgIGiiQHey/P+tpYoiOfUtVDPLr3SSiVGF76CD3Dmszt851vFdedlirsuWeVPAVIB787Hx62zw0VJAZxwi0S8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Have = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Have", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select(Text.Split([Have], " "), each Text.Length(_) <> 3)))
in
    #"Added Custom"

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Alexjaco2
New Member

That works! Thanks!

Greg_Deckler
Super User
Super User

@Alexjaco2 Maybe this?

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fc2xDYAwDATAVazUFO/Y2ImYgjrK/mvgIGiiQHey/P+tpYoiOfUtVDPLr3SSiVGF76CD3Dmszt851vFdedlirsuWeVPAVIB787Hx62zw0VJAZxwi0S8=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Have = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Have", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(List.Select(Text.Split([Have], " "), each Text.Length(_) <> 3)))
in
    #"Added Custom"

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors