Excel Like TRIM Function in Power Query
Ғылым және технология
Check out our newly launched M Language course ↗️ - goodly.co.in/learn-m-powerquery/
Here in this video, we will talk about how you can remove unwanted spaces from your text values in Power Query. We'll also learn about creating dynamic custom functions.
===== ONLINE COURSES =====
✔️ Mastering DAX in Power BI -
goodly.co.in/learn-dax-powerbi/
✔️ Power Query Course-
goodly.co.in/learn-power-query/
✔️ Master Excel Step by Step-
goodly.co.in/learn-excel/
✔️ Business Intelligence Dashboards-
goodly.co.in/learn-excel-dash...
===== LINKS 🔗 =====
Blog 📰 - www.goodly.co.in/blog/
Corporate Training 👨🏫 - www.goodly.co.in/training/
Need my help on a Project 💻- www.goodly.co.in/consulting/
Download File - goodly.co.in/remove-spaces-be...
===== CONTACT 🌐 =====
Twitter - / chandeep2786
LinkedIn - / chandeepchhabra
Email - goodly.wordpress@gmail.com
===== CHAPTERS =====
0:00 Intro
0:21 Removing Spaces
4:28 Creating a Function
8:51 Applying to Multiple Columns
10:44 My Courses
===== WHO AM I? =====
A lot of people think that my name is Goodly, it's NOT ;)
My name is Chandeep. Goodly is my full-time venture where I share what I learn about Excel and Power BI.
Please browse around, you'd find a ton of interesting videos that I have created :) Cheers!
- - - - -
Music By: "After The Fall"
Track Name: "Tears Of Gaia"
Published by: Chill Out Records
- Source: goo.gl/fh3rEJ
Official After The Fall KZread Channel Below
kzread.info/dron/GQE.html...
License: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
Full license here: creativecommons.org/licenses
Пікірлер: 169
I’ve scrolled past this video for a while. Finally checked it out and I wish I would have earlier. This is incredibly helpful to format the messed up data I get every day. Thank you so much as always. You are awesome.
great sir ................................Mashallah
Thanks! Another super video. I've been doing Power Query since Data Explorer, and I'm still learning from your videos.
@GoodlyChandeep
Жыл бұрын
Glad to hear! Thank you for the tip
Fantastic! I had no idea we could apply a function to all columns like that. Thank you a lot!
Very practical solution..Had this exact issue last month.. Replicating the function to all columns was genius :) learnt something new today..
@GoodlyChandeep
Жыл бұрын
Glad it was useful !
Hey thanks for this Goodly, it's a really helpful video and just what I needed. Your presentation style and clear explanations are great. Keep up the great work.
YEAH! This is cool. Thank you so much!
Thank you again for another interesting video, it was great that you went on to make a function, which I still find tricky at times, especially if there are multiple columns to work on, not so bad if it works on a table.
Thanks for this amazing video! It's really helpful ❤
An excellent video. Thanks
As you said, that is AWESOME!
Muito obrigado pelo vídeo! Gostei muito!!!
Dude, this video is THEEEE BEST, helped me with so many problems I was having today! GREAT WORK !!!
Never saw a function creation in Power Query before! I have to try it out in my reports!
It is pretty awesome. I came across with your channel two days ago and I am really excited about all the thing that I have learned. Kudos
Thank you!
That is awesome!
Very good solution....
A great and smart Solution using the given capabilities of M-Functions.
Thank you, it helped me to solve my problem beautifully!
what to say? simply brilliant. Very useful functions and approaches explained in really simple language. Thank you for sharing these tricks. see you next time.
Thanks for another very useful and helpful content @Chandeep. Would you think to include inseparable space (which is very common in copied text from browsers) and line break characters next time? It was my challenge last week, somehow I sorted it out but I am sure that you have simpler and more sophisticated solutions.
Espetacular!!
That's awesome ❤❤❤ thanks so much bro
Thank you Chandeep, your channel is my no. 1 source for learning for free. I guess this video is a duplicate of another one labeled "Remove unwanted spaces"! But thank you again and again. 😊
You read my mind Chandeep! Was thinking about scalability of this custom function. This is perfectly ✅done. Thanks a million
@GoodlyChandeep
Жыл бұрын
Glad to hear!
Thanks for posting this useful video. As always you explain things so clearly. What I learnt here will certainly be useful in the future.
@GoodlyChandeep
Жыл бұрын
Great to hear!
Thanks for the incredible video. Please keep up the great works.
@GoodlyChandeep
11 ай бұрын
Thanks, will do!
Very useful video, thank you. Is there a way of creating a library of these personal functions and use them in different queries, something like the personal macro workbook for Excel?
Really impressive ! Seems so easy, but for anybody it would require hours of work. Thx a lot for this nice tip
@GoodlyChandeep
Жыл бұрын
You are welcome!
Always fantastic stuff, Chandeep! Thanks again.
@GoodlyChandeep
Жыл бұрын
Glad to hear that!
Excellent explanation, as always. It is very important to learn how to correctly create custom functions.
@GoodlyChandeep
Жыл бұрын
Glad you like it!
Pretty awesome! ;) Thanks so much. Very usefull solution
@GoodlyChandeep
Жыл бұрын
Glad you like it!
Excellent Boss!! Thanks Bro!!!
@GoodlyChandeep
Жыл бұрын
You're welcome!
It's a great Solution... Awsome.. !
@GoodlyChandeep
Жыл бұрын
Thanks !
Thank you very much for the amazing solution.
@GoodlyChandeep
Жыл бұрын
Always welcome
Belleza!!!
@GoodlyChandeep
Жыл бұрын
Thanks!
Great very useful trick . Thanks.
@GoodlyChandeep
Жыл бұрын
Glad you liked it!
Awesome. Your contents are wonderful.
@GoodlyChandeep
Жыл бұрын
Thanks!
Very interesting and helpful Video. thank you very much for sharing
@GoodlyChandeep
Жыл бұрын
Glad you like it !
I'm going to feel sMarter all day today because I spent 12 minutes watching this video this morning. Thank you, Chandeep! 🙏
@GoodlyChandeep
Жыл бұрын
Cool!
Awesome 👌 You took care of scalability very well
@nishantkumar9570
Жыл бұрын
If we need to apply the function on some of selected columns, do we need to provide those columns name in { }?
@GoodlyChandeep
Жыл бұрын
To omit a few columns from the transformations, in the curly braces you'd write something like this. { {"ColumnName", each _}, {"ColumnName2", each _} }
after this brilliant content ,the question why Microsoft make Trim function in PQ not as in excel !!!!! Thanks Chandeep !
Really good tips, saved the best for last!
@GoodlyChandeep
Жыл бұрын
Thanks!
Very useful function! Thank you Sir.
@GoodlyChandeep
Жыл бұрын
Glad you like it
This is awesome! And I have a doubt to change the date range of an SQL query embedded into excel power query, as in for now I am changing it manually as I need to pull the details on incremental
Much useful in cleaning the data, Thank you very much
@GoodlyChandeep
Жыл бұрын
Glad to hear that
This is godly! Super o super....
@GoodlyChandeep
Жыл бұрын
Thank you!
Very Nice Video as well as Nicely Explained each and every thing clearly..
@GoodlyChandeep
Жыл бұрын
Thank You!
Thanks Chandeep!! Another great video full of useful tricks and tips. Will keep this technique at my fingertips for the future. Thumbs up!!
@GoodlyChandeep
Жыл бұрын
Great!
@wayneedmondson1065
Жыл бұрын
@@GoodlyChandeep Here is something I created adding a custom column using List.Accumuate. Also gets the job done: Text.Trim( List.Accumulate( {0..Text.Length([Text])}, [Text], (state,current)=> Text.Replace( state," "," ") ) )
I'm addicted to your videos.😋
@GoodlyChandeep
4 ай бұрын
That's what I'd like to hear. Thank you ❤️
God level 🙏🙏.. Really loved it.
@GoodlyChandeep
Жыл бұрын
Thank you !
Hi Chandeep, great vid. Is there a way to remove duplicate in the list before the text combine?
Excellent as usual Chandeep 👍 👍
@GoodlyChandeep
Жыл бұрын
Thanks a ton
{ } to apply on all columns... Awesome, indeed! Gonna steel that 🙂
Lol....Excel is fun... Very good man!!!! Thank you!
@GoodlyChandeep
Жыл бұрын
Glad you enjoyed it!
Awesome.
@GoodlyChandeep
Жыл бұрын
Thanks!
Thank You !!! Another great lesson on the creative use of PQ to solve a problem that can sneak up and "bite" the unsuspecting power query user. (Ask me how I know... ha ha ). Just wondering: wouldn't there be a creative use of replace (i.e., Table.ReplaceValue to replace 2 spaces with single space (even if it had to be repeated) )?
👏 Awesome
@GoodlyChandeep
Жыл бұрын
Thank you!
Thank 😊, very interesting
@GoodlyChandeep
Жыл бұрын
Glad you liked it!
Excellent, Thank you very much. It would have been even better if you left the code in the description or something.
Amazing 👌🏻
@GoodlyChandeep
Жыл бұрын
Thank you!
Great Video
@GoodlyChandeep
Жыл бұрын
Glad you enjoyed it
The way you explain is amazing one can easily understand even complex things . Excel is fun , laila gharani and ur KZread channel are very helpful , keep it up
@GoodlyChandeep
Жыл бұрын
Thanks Amit!
Amazing👍👏👏👏
@GoodlyChandeep
Жыл бұрын
Thanks!
Awesome 😎😎👍🏻
@GoodlyChandeep
Жыл бұрын
Thanks ✌️
Another great learning
@GoodlyChandeep
Жыл бұрын
Glad it was helpful!
@modernboutique1389
Жыл бұрын
@@GoodlyChandeep i sent you text on LinkedIn from Harmeet Singh
thanks for your tricks, awesome. One issue as while added a new column to excel source table, data model is getting failed. Is there anyway to solve this.
Last trick is really amazing - thank you 🙏
@GoodlyChandeep
Жыл бұрын
You're welcome!
You Are awsome! Thanks a lot! One question though: I get confused as how a field/column sometimes is indicated by { } as in the last example in this video ({ } without any value means all columns) and sometimes by [ ] as in using the gear/dialogue box for the code (then your column name is between [ ]). Care to enlighten me…? Thanks
Hi Chandeep, you are amazing👍
@GoodlyChandeep
Жыл бұрын
Hey, thanks!
Bruxaria! 🙂
This was really helpful, however, can you also make a similar query if we have both data and numbers?
Thanks for sharing ❤
@GoodlyChandeep
Жыл бұрын
Glad you enjoyed it!
@FRANKWHITE1996
Жыл бұрын
@@GoodlyChandeep always🙌
I appreciate your hard work. I followed the same and showing as list. Affer clicking on each item i.e., it is not showing as list. Just showing as normal string instead of line by line in list. What might be the reason.
Brilliant
@GoodlyChandeep
Жыл бұрын
Thanks!
Thanks
@GoodlyChandeep
Жыл бұрын
Glad you like it!
Great work. I find power Query misleading. The assist for the function table.transformcolumns doesnt show all options from the start, you have to type {} for it to show the next availeable option
It must be terrible to be so clever!! LOL Thanks from South Africa.
@GoodlyChandeep
Жыл бұрын
Glad you enjoyed it!
👌👌
@GoodlyChandeep
Жыл бұрын
Thanks!
Thanks brother. Do you have solution to convert ranges of different excel sheet into table in one go.
👍
kindly make video on Evaluate DAX function
How to deal with null in columns
Chandeep I have another approach to this problem. First replace the " " with " |" then replace the "| " with "" (null) and lastly replace the "|" with "" (null) again. I hope this will work.
Great 👍🏼. I have two questions please! 1- Is it possible to use for each to go through all columns instead of using table transform?! 2- Is there a solution to do the opposite, in case I want to add spaces between merged words?
@vishnuvardanatmakuri
Жыл бұрын
For q2. If u r able to split the merged word based on some delimiter then it's just following merge function to recreate the sentence w spaces
@priyeshsanghvi8424
3 ай бұрын
You can try Text.Insert function
Hi dear, i tried this approach, but space not removed by list.select. can you confirm what would be the issue. Is this related other characters???
Bro i have data in excel file, sheet name xyz, now if i change sheet name abc then the will load to power query?
Hi Chan vedy good videos than you, in this one you could avoid to use Text.Trim because the spaces will be deleted from the other formulas.
I like how you giggle on results you get. 😁👌
@GoodlyChandeep
Жыл бұрын
he he he.. Did I? I went back and saw the whole video again 😂
@Rice0987
Жыл бұрын
@@GoodlyChandeep yeah, you always do that and this is cute, don't stop it, it's your feature😁👌
@GoodlyChandeep
Жыл бұрын
@@Rice0987 Still couldn't figure out where I did it :D
@Rice0987
Жыл бұрын
@@GoodlyChandeep read the first comment: when you get result. And i understand, why you act so, cause power query is amazing instrument to get results in couple steps, when before you should make several complex manipulation. That's why you gig.😊
The possibility of using empty curly braces to transform all the columns of a table is invaluable. Thank you, for teaching us how to do it!
Hello thank you for this video, I applied it but in the Text.Select it generate error. In the column though it is text type there are numbers as well. Thank you helping find what os wrong.
@tigitang8719
6 ай бұрын
You're selecting the text for the list, therefore, you need to use List.Select, not Text.Select.
Thank you, I come across an error when I use the function, An error occurred in the ‘’ query. Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression? Can you please help me to solve this error? thank you
AMAZING! How do I give a dozen Likes? Could the function be changed so that just a column is provided as the permeameter instead of the whole table?
@GoodlyChandeep
Жыл бұрын
Thanks! Your 1 like worth a Dozen 💚
Thanks bro. That last tip was genius. I've adopted your solution but removed the Trim part of the function. Any harm? William. (InputText as text) => let TrimmedText = Text.Combine( List.Select( Text.Split( InputText, " " ), each _ "" ), " " ) in TrimmedText
@tigitang8719
6 ай бұрын
Text.Trim function removes leading and trailing spaces.
Is this there in power query course
@GoodlyChandeep
Жыл бұрын
No I am working on creating a new course on M language.
@sujit3375
Жыл бұрын
@@GoodlyChandeep please do it asap Its HIGHLY needed by all PBI developer
When I load Names with Spaces into PQ they seem to be already trimmed, although when Close and Load hey aren't. Is there a setting which automatically shows them as trimmed even if they are not One other thing for the last part it causes an Error if you RemoveSpace Function for all if it has a Date Column. How can you add step to select certain columns :)
@GoodlyChandeep
Жыл бұрын
I don't know of any such setting. You could be dealing with something that looks like a space but isn't.
@tigitang8719
6 ай бұрын
You can omit the Date column for the formula to avoid getting errors.
How to dynamic date start jan 2022 end Des 2022 by pòwer query
Failed to save modifications to the server. Error returned: 'The following system error occurred: Class not registered '. This shows while loading data what can I do?
Why {} ??