Remove Leading Zeros from Text in Power Query

Поделиться
HTML-код
  • Опубликовано: 11 фев 2025

Комментарии • 54

  • @BIGorilla
    @BIGorilla  Год назад +1

    To learn more about functions and syntax make sure to check out: powerquery.how/
    Enjoy!

  • @JonathanExcels
    @JonathanExcels 3 года назад +7

    Even better than the remove zeros was the tip about transforming instead of creating a new column. Thank you.

    • @BIGorilla
      @BIGorilla  3 года назад +1

      Thanks Jonathan. That trick is useful for many transformations! 😁

  • @Softwaretrain
    @Softwaretrain 2 года назад

    Before watching this video I was trying to think about the solution but since I didn't know Text.TrimStart, I solved it by complicated following formula:
    Add Custom Column:
    [
    a=Text.ToList([Values]),
    b=List.RemoveItems(a,{"0"}){0} ,
    c=List.PositionOf(a,b),
    d=Text.Range([Values],c)
    ][d]
    But after watching this video it was mind-blowing to know Text.TrimStart formula.
    Thanks for sharing.

  • @joebutkevicius7218
    @joebutkevicius7218 2 года назад +1

    Simple, easy, and elegant solution. Thanks!

  • @mararamitchpeace
    @mararamitchpeace 8 месяцев назад

    You are a lifesaver! I am pulling Data From Snowflake to populate a Material transaction report and the Materials had leading zeros that kept the data from having the ability to link to other Tables in the Dataset.... this had definitely changed the game!

  • @SMITDEDHIA96
    @SMITDEDHIA96 2 года назад +1

    THANK YOU, BI Gorilla !!

  • @laetitiabailly6278
    @laetitiabailly6278 Год назад

    Thanks for sharing !! Simple and Useful !

  • @tipp0183
    @tipp0183 2 года назад +1

    exactly what i needed, thank you.

  • @high4242
    @high4242 3 года назад +1

    don't know why I had so much trouble... finally found this.. thanks :)

  • @JohnKruse-o9f
    @JohnKruse-o9f Год назад

    Exactly the solution that I was looking for!!! Thank you!

  • @sublimefan311311
    @sublimefan311311 10 месяцев назад

    I work with UPC’s all day long and this is a big issue. Thank you so much for

  • @Nelapudi15
    @Nelapudi15 Год назад

    Exactly what Im looking for. Thanks alot

  • @EBackwards
    @EBackwards 2 года назад +1

    Thanks for the Video! When able it would awesome to have the text needed posted in comments/description! I'll do that once I get it working here but I have to side by side and type lol
    But please don't let that overshadow how awesome it is for me to find this! Just what I was looking for! THANKS!

  • @lyle151
    @lyle151 Год назад

    Thank you for making my queries cleaner :D

  • @morelove2182
    @morelove2182 Год назад

    Unbelievable. Thanks for helping. God Bless you.

  • @FsoOmar
    @FsoOmar 10 месяцев назад

    Yes, it was 💯 useful. Thanks a bunch.

  • @llfteixeira
    @llfteixeira 2 года назад

    Thanks man, you just save my day.

  • @giorgikvatchadze4928
    @giorgikvatchadze4928 3 года назад +1

    Wonderful. Thank you!

  • @allisterspeelman3694
    @allisterspeelman3694 2 года назад

    Nice. Thanks for this. PowerBI

  • @balrajvirdee1087
    @balrajvirdee1087 Год назад

    Thanks so much, this really got me out of a pickle 👍🏽👍🏽

  • @karimallahwala7022
    @karimallahwala7022 Год назад

    Very good Tricks for List.Sort. Thank you very much

  • @anwarkrg9292
    @anwarkrg9292 9 месяцев назад

    Great, thanks Sir for sharing it works well👍👍

  • @Startzc
    @Startzc 2 года назад

    Thank you, very simple solution.

  • @mykavkaz
    @mykavkaz 2 года назад

    does this option still works? My formula can't find the column I need to remove zeros from...

  • @shirleymoreman6725
    @shirleymoreman6725 2 года назад

    Excellent! Exactly what I wanted to do Thank you

  • @lenac3587
    @lenac3587 3 года назад

    What a neat trick! The takeaway for me is to nest a function in an existing power query step. This is new. I always use the shortest number of steps to improve performance

    • @BIGorilla
      @BIGorilla  3 года назад

      That's right Lena. Combining these elements really allows you to keep the query clean. ☺️
      Less steps doesn't always mean better performance, but sometimes it can.
      - Rick

  • @andycarol7422
    @andycarol7422 2 года назад

    Legend!
    Thank you!

  • @mmariogomes
    @mmariogomes 2 года назад +2

    Sensacional. Obrigado por compartilhar

  • @thuynportalios2337
    @thuynportalios2337 Год назад

    Thanks so much for the solution. That's exactly what I was looking for. I have another problem and hope that you can make a video that helps cleanse/trim the delimiter of the name column in Power Query. Example: David, Smith ; egers davide/carol

  • @roxteleanu5002
    @roxteleanu5002 Год назад

    thank you so much, almost had it right but didn't think of putting my 0 between quotation marks😅

  • @ephantusmwihaki7037
    @ephantusmwihaki7037 2 года назад

    Thank you good sir

  • @Kay-qg5td
    @Kay-qg5td Год назад

    Will this work for direct query?

  • @claudinebeunens8721
    @claudinebeunens8721 2 года назад

    Great tip, thanks ! Though the issue I am facing is that it's not applied to all of my records, some remain with leading 0. I added a step to really make sure it's of type Text but issue remains. What could be the reason for this?

    • @BIGorilla
      @BIGorilla  2 года назад

      Hi Claudine, can you share an example where that happens?

    • @claudinebeunens8721
      @claudinebeunens8721 2 года назад

      ​@@BIGorilla drive.google.com/file/d/1Lx5Vz5Km7kFfCPhW1QR0HuuuwdOeZpeb/view?usp=sharing Hi, not sure if this link will work. There is a step in the query "Notes" on the data column Task. The Task column in the output shows e.g. both "0605" & "605"

    • @BIGorilla
      @BIGorilla  2 года назад

      @@claudinebeunens8721 I can open the file, but can't see any of its contents. The data comes from Azure Databricks.
      Some example data would help, in the current file I can't fiddle around. Perhaps you can create an example file using the 'add data' feature. Its difficult for me to tell without.

    • @claudinebeunens8721
      @claudinebeunens8721 2 года назад

      @@BIGorilla Issue got solved, there was another query interfering where we had to apply the same trimming, thanks for your help!

  • @neilgore
    @neilgore 2 года назад

    Super.. thanks

  • @undercoveragent1735
    @undercoveragent1735 2 года назад

    Thanks this is pretty good. Is there a way to only remove the FIRST 0. For example I'd like 00:35:58 to become 0:35:58 instead of :35:58

    • @BIGorilla
      @BIGorilla  2 года назад +1

      Hey undercover agent,
      If your value is of time format, you can have a look at
      docs.microsoft.com/en-us/powerquery-m/time-totext
      Time.ToText allows you to input a formatting string and return a different format.
      If it’s just text, you can use:
      docs.microsoft.com/en-us/powerquery-m/text-removerange
      Something like: if Text.Start( [Value], 1) = “0” then Text.RemoveRange( [Value], 0, 1 )
      For more examples of text functions here’s my new blogpost:
      gorilla.bi/power-query/text-functions/#remove-text

  • @minkeiken1283
    @minkeiken1283 Год назад

    what if I have several preceding zeros, but I just only need to cut one zero out? please help

  • @Yakshithnandan
    @Yakshithnandan 2 года назад

    When column have leading two zeros then need to remove those zeros other then two zeroes let other values be same , could give me solution ?

    • @BIGorilla
      @BIGorilla  2 года назад

      Please can you share some example values?

  • @CarlosJimenez-pb6dq
    @CarlosJimenez-pb6dq 2 года назад

    thanks!

  • @kikilet3
    @kikilet3 3 года назад

    Great ! Thanks

  • @felipesignorellireis7839
    @felipesignorellireis7839 3 года назад

    very cool

    • @BIGorilla
      @BIGorilla  3 года назад

      Always a pleasure to see your support in the comments, thank you Felipe! 😁😁

    • @felipesignorellireis7839
      @felipesignorellireis7839 3 года назад

      @@BIGorilla your welcome. Soon I'll write a doubt for you to help me.

    • @BIGorilla
      @BIGorilla  3 года назад

      @@felipesignorellireis7839 look forward to it! 😁

  • @Phoenixspin
    @Phoenixspin 3 года назад +1

    Leading zeros were invented by the Devil to torment us BEFORE some of us even make it to hell. Not fair.

    • @BIGorilla
      @BIGorilla  3 года назад

      😂😂 That sure isn't fair Phoenixspin. I hope it comforts you knowing you now have the tools to battle them leading zeros!