Power Query - Dynamic Column Selection

  Рет қаралды 5,481

BCTI

BCTI

Күн бұрын

Пікірлер: 60
@HVACALC
@HVACALC 2 ай бұрын
This channel is an easy subscribe. No fluff ever + high quality concise expert content.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@HVACALC Thank YOU for such nice compliments! We really appreciate your subscribership (if that’s a real word.)
@jazzista1967
@jazzista1967 2 ай бұрын
Great example on how to work with lists in Power Query. Lists are extremely powerful and very under used, Thanks for posting these great examples!
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@jazzista1967 My pleasure. Thanks for taking the time to watch and comment.
@jazzista1967
@jazzista1967 2 ай бұрын
Good morning Byron! Thanks . Watching your examples before heading to the office! Man, you really have great tutorilas! . Do you happen to have a example on how to avoid using hardcoded column names using Table.ColumnNames . I have a very fragile query that if i add a column ,my query will break. Thanks and have a great day
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@jazzista1967 What are you drawing your data from? What is the source?
@jazzista1967
@jazzista1967 2 ай бұрын
Hello! Sorry for the late reply. I dump the data in excel files in a dedicated folder. Right now, the consolidated files works however its fragile because it has all the column names hardcoded in red font.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@jazzista1967 Which step are the hardcoded column names appearing? Ex: a data typing step; a column rename step; a pivot/unpivot step?
@vramarathnam
@vramarathnam 3 күн бұрын
Thank You very much. Your teaching is an eyeopener. I Learnt a Lot.
@bcti-bcti
@bcti-bcti 3 күн бұрын
Thank you so much for the compliment. I'm glad you find it helpful. Thanks for watching.
@Bienvo0921
@Bienvo0921 2 ай бұрын
As always, you are an excellent PROFESSOR!
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@Bienvo0921 Thank you!!!!!!
@Paladin101
@Paladin101 2 ай бұрын
A couple of weeks late on this one for timing 😉 but I’m going to use this instead of the solution I’ve implemented. Thanks again 👍
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@Paladin101 Yeah, sorry about that. I was thinking all along, “I bet Paladin101 is wishing I’d finish this one up already.” 🤣 Thanks for watching.
@clay4gli
@clay4gli 2 ай бұрын
Great video. Many other creators make this much harder with their approach. Your solution seems much easier to follow. I am eager to try it. Thank you.
@bcti-bcti
@bcti-bcti 2 ай бұрын
There is even an easier way to do this (see the video description), but I wanted to use this explore other PQ features. Thanks for watching.
@ericliu79
@ericliu79 2 ай бұрын
Great one. my alternative : =Table.AddColumn(Source, "Custom", each List.Average(List.Skip(Record.ToList(_),1)))
@bcti-bcti
@bcti-bcti 2 ай бұрын
That is another good way, but be careful that the position of the field doesn't change. Of course, you could say the same thing about my solution in that, "you better hope the field name doesn't change." Every method has risk. Thanks for watching.
@ericliu79
@ericliu79 2 ай бұрын
thanks.
@FsoOmar
@FsoOmar 2 ай бұрын
That's what I've been waiting for. Thank you a zillion! 👍👏👏👏
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@FsoOmar You are welcome… a zillion!
@Bhavik_Khatri
@Bhavik_Khatri 2 ай бұрын
Excellent tutorial.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@Bhavik_Khatri Thank you so much for saying so!
@Bhavik_Khatri
@Bhavik_Khatri 2 ай бұрын
@bcti-bcti No worries. We are all on the same path of continuous learning and development.
@SamehRSameh
@SamehRSameh 2 ай бұрын
Marvelous 🎉🎉 we need more and more
@bcti-bcti
@bcti-bcti 2 ай бұрын
Thank you! I'll do my best to keep producing.
@zzota
@zzota 2 ай бұрын
Brilliant! I'll definitely be using this at work.
@bcti-bcti
@bcti-bcti 2 ай бұрын
Glad to hear it helped. Thanks for watching.
@robbe58
@robbe58 2 ай бұрын
TOP 💯 Very well explained (in detail), showing all the steps needed to execute and get this result.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@robbe58 thank you so much for your continued support.
@kkravch
@kkravch 2 ай бұрын
Excellent PROFESSOR, fully agree, nothing to add... :)
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@kkravch Thank you!
@chrism9037
@chrism9037 2 ай бұрын
So well-explained, thank you
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@chrism9037 you are quite welcome. Thanks for your support.
@excel_along_the_way
@excel_along_the_way 2 ай бұрын
Thank you, this is very helpful and a method I would definitely use. This should even work if you want to keep your monthly data when you import data from external source.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@excel_along_the_way I don’t see why it wouldn’t. Thanks for watching.
@ExcelWithChris
@ExcelWithChris 2 ай бұрын
Thanks my friend. Greetings from South Africa.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@ExcelWithChris Greeting. Hope all is going well. Thanks for taking the time to watch.
@rajanpradeepankarath8846
@rajanpradeepankarath8846 2 ай бұрын
this is brilliant!
@bcti-bcti
@bcti-bcti 2 ай бұрын
Thanks! Glad you enjoyed it.
@tomstrack42
@tomstrack42 2 ай бұрын
Excellent, thank you!!!
@bcti-bcti
@bcti-bcti 2 ай бұрын
Thank YOU for watching and commenting.
@RichardJones73
@RichardJones73 2 ай бұрын
Nice explanation
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@RichardJones73 thank you!
@Adam_K_W
@Adam_K_W 2 ай бұрын
Amazing as always! You're out there solving problems that people really need solved and your manner and presentation skills are Excellent! Thanks for all you do! That said, I have a challenge for you related to this scenario. I work with Forecast files with variable numbers of monthly columns setup much like this. Part 1. There are roughly 43 columns of different values before we get to the actual monthly columns (Task Codes, P.O. Numbers, etc.). ? Do I need to list each of the individual field names in the "Record.Remove Fields" section or can I do that differently? Part 2. Here's where it gets tricky... My forecast files are for projects in process. Some of the columns are for months in the past (where actual costs are summed up) and the remaining columns are for the future months/balance to finish. Each month, when we update the forecast period, the current month is visually moved to the prior month via formatting those cells gray, with the remaining forecast months cells are yellow. ?: Is there a way to dynamically create the list of ONLY the future months and ignore the monthly columns in the past?
@bcti-bcti
@bcti-bcti 2 ай бұрын
Such nice words. Thank you for watching and your support.
@Adam_K_W
@Adam_K_W 2 ай бұрын
@@bcti-bcti I use your solutions very often in my work. They are game changers every time.
@yousrymaarouf2931
@yousrymaarouf2931 2 ай бұрын
Fantastic
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@yousrymaarouf2931 thank you!!!
@danilomassarelli1644
@danilomassarelli1644 2 ай бұрын
Hi, can I ask for you a technical question? are there any alternative solutions to create a column of records with use the Table.AddColumn function instead to use underscore (_) ? Thanks so much in advance for your help
@bcti-bcti
@bcti-bcti 2 ай бұрын
If there is, I'm not aware of it. Let me know if you find another way so we can both learn something. Thanks for watching.
@danilomassarelli1644
@danilomassarelli1644 2 ай бұрын
​@@bcti-bcti I used this solution but I was finding a PQ function to use. I have add a new index column and then i wrote this code: Table.AddColumn(Idx, "Rcd", each Idx{[Indice]}, type record). But I don't like it I would like an other solution. Who knows other solutions? thx
@SJGorilla
@SJGorilla 2 ай бұрын
It’s much easier to create a new query with a list using headers and remove the first column header to get dynamic list of months and replace the hard coded month headers with this new list.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@SJGorilla That’s the great thing about Power Query: there’s always more than one way to solve the problem. Thanks for watching.
@nickmorris8993
@nickmorris8993 2 ай бұрын
Excellent solution and explanation. As an alternative, how about this single step? Table.AddColumn ( Source , "Avg Sales" , each List.Average ( List.RemoveFirstN (Record.ToList(_),1) ) )
@nickmorris8993
@nickmorris8993 2 ай бұрын
Perhaps the slight advantage of this version is that we don't need to name the "SalesPerson" column, so it will still work even if the column header gets changed. Just a thought ...
@bcti-bcti
@bcti-bcti 2 ай бұрын
FANTASTIC! I really like this method as it is not name-dependent (like you mentioned in your other comment.) Thanks for making this better.
@JenMayB
@JenMayB 2 ай бұрын
I would highlight the first column and select unpivot other columns and then pivot them. Or i would create a list step from table.getheaders (or something to that effect) and then load that list step into the average step.
@bcti-bcti
@bcti-bcti 2 ай бұрын
@@JenMayB it’s always great to see how others solve the same problem but from a different approach. Thanks for watching.
Power Query - Get Top N by Group
22:19
BCTI
Рет қаралды 2,4 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,6 МЛН
Муж внезапно вернулся домой @Oscar_elteacher
00:43
История одного вокалиста
Рет қаралды 7 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 12 МЛН
Why You'll Regret Not Automating Your Excel Lists in 2024
8:15
Microsoft Excel Tutorials
Рет қаралды 955
Power Query - Avoid "Helper Queries" (+10 Cool Tricks)
18:40
Using the List technique in Power Query to recombine tables
6:51
Access Analytic
Рет қаралды 5 М.
Custom Comparer Function for Table.Group in Power Query M
23:17
Power Query - Faster & Easier Parameters
13:38
BCTI
Рет қаралды 42 М.
Power Query - Alternate Group By Strategies
12:29
BCTI
Рет қаралды 4,9 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,6 МЛН