The logic that goes into this is fascinating. And, more importantly, the way you explain what you're doing and why is next-level stuff. Plus, you always sound like you're having a good time. Thanks!
@excelisfun2 жыл бұрын
As you probably know, when you know the hows and whys, then fun is easy! You are welcome for the video, Ben.
@ExcelInstructor3 жыл бұрын
my work inbox is flooded by links to ur videos!!!!! Thank you. Best teach ever does even cover it in 1%... that's how gr8 ur teaching skills are :)
@LeilaGharani7 жыл бұрын
Great! Grouping by numbers is a great idea - and then subtracting the extras - very nice! Thanks for sharing.
@excelisfun7 жыл бұрын
You are welcome! There is another way too - Tomorrow or Sunday I will post a slightly different way to do it with the MIN function, a trick from our Online Excel Teammate Bemint : )
@LeilaGharani7 жыл бұрын
Very much looking forward to that! It's amazing how fast you can make all these super informative videos and still have such great quality! Thank you for all that you do!
@CeliaAlvesSolveExcel3 жыл бұрын
Beautiful solution, Mike!
@aamdigital86164 жыл бұрын
This is an amazing video that saved the day for me. Literally I wasted a whole day and then finally watched this video very very carefully. This does way more than as simple rank. It actually does a RANK() BY PARTITION like the SQL function. You have to pay attention to his second index maneuver. This is a RANK BY PARTITION. AMAZING. I'm a believer in magic. Might have to buy the shirt immediately.
@excelisfun4 жыл бұрын
No need to buy the shirt, just watch, and when you learn leave a comment and click that thumbs ups : ) : )
@shoeshines21214 жыл бұрын
Very cool solution to make use of the "Add Index" feature to generate the rank! Definitely easier in an Excel Worksheet or DAX, but it is a good learning exercise to understand the nuts and bolts of Power Query.
@excelisfun4 жыл бұрын
Thank you for your amazing support, T P!!!!!
@sherryizzie53094 жыл бұрын
Thanks for sharing, Mike! I just used this trick to build my top customers’ sale report today! Queries rock!
@olaayorinde68657 жыл бұрын
Thank you mike, this video is amazing. If you remember I asked for COUNTIF function in power query, this video just gave me the solution. You are a blessing! A million thanks!
@excelisfun7 жыл бұрын
That is awesome: I am glad it helps with COUNTIF : )
@JidduVillarin7 жыл бұрын
Awesome work! I have nothing to use this on at the moment but this has just given me another tool to use in another sticky situation. Thanks for all the great work you do on this platform.
@excelisfun7 жыл бұрын
You are welcome!
@pmsocho7 жыл бұрын
Great as always!
@excelisfun7 жыл бұрын
Thanks, pmsocho!!
@eCabinetstipsandtricks7 жыл бұрын
Wow, That is just amazing. Thanks!
@excelisfun7 жыл бұрын
You are welcome : )
@sumardjo3 жыл бұрын
very very Thank you This is good for my learn your knowledge is useful for me clear and excellent to your sample file
@excelisfun3 жыл бұрын
You are welcome : )
@armondnazarian44554 жыл бұрын
Thanks Mike It was a great video!
@excelisfun4 жыл бұрын
You are welcome, Armond!!
@Al-Ahdal7 жыл бұрын
Excellent and informative as always.
@excelisfun7 жыл бұрын
Glad it helps!
@MiscaXL7 жыл бұрын
Love your solution! Personally, I'd group by Total Quantity before adding any indexes. If you add the index row before extracting the tables, you'll get the final rank right away. Unfortunately if you do it that way you don't get to learn nearly as much as using the slightly longer way.
@excelisfun7 жыл бұрын
Can you post your M Code, so we can all see : )
@MiscaXL7 жыл бұрын
I'm sorry but my way gave the wrong results in the end: Instead of skipping after multiple equal numbers it continued from the next number. I could've altered my code to add the number of rows from the previous to the index but the final code would've been even more complex than yours. So here's my M code that gives "almost the right results" :) : let Source = Table.Combine({fTransactions, NewRecords}), #"Grouped Rows" = Table.Group(Source, {"Product"}, {{"Total Quantity", each List.Sum([Quantity]), type number}}), #"Grouped Rows1" = Table.Group(#"Grouped Rows", {"Total Quantity"}, {{"Records", each _, type table}}), #"Sorted Rows" = Table.Sort(#"Grouped Rows1",{{"Total Quantity", Order.Descending}}), #"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1), #"Removed Columns" = Table.RemoveColumns(#"Added Index",{"Total Quantity"}), #"Expanded Records" = Table.ExpandTableColumn(#"Removed Columns", "Records", {"Product", "Total Quantity"}, {"Product", "Total Quantity"}) in #"Expanded Records"
@excelisfun7 жыл бұрын
Thanks for posting : )
@bistruca2 жыл бұрын
Thanks
@excelisfun2 жыл бұрын
You are welcome!
@nattawut_chatwiriyacharoen6 жыл бұрын
Thanks a lot, Mike. This video makes me clearly understand "Group By" and "Index Column" in Power Query. Unfortunately, there is no "Sort By Column" in Power Query (but Power Pivot has this command)
@excelisfun6 жыл бұрын
Yes, sorting is tricky in Power Query.
@ExcelInstructor3 жыл бұрын
What about the rank going of increments of 1 meaning that after 7th rank we got 8th instead of 10. or to get 2 instead of 3.?
@jerrydellasala76434 жыл бұрын
Mike - I'm running O 365 Insider. I was able to add the "Amount to Subtract" column as demonstrated, and when I look at the table for record 6319712 see 3 rows with 0,1,2 in the new column. However when I go to expand the table the new Subtract column does not show up! The Subtract column even shows up when I click on Table (instead of to the right), but does not show up in the Expand dialog. Bug?
@LTV_GOD6 жыл бұрын
As always very good explanation and something new every time (how to add Index inside of related table)! As for me, seems like you have added extra steps, after the grouping by Total Units you can simply add new Index Column and expand Records because its strange that if you can not see Rank 8? it is logical to see Rank 8 after the Rank 7. Is not it? Anyway, an example video is COOOOLLL!!!
@JarosawBorzecki4 жыл бұрын
That's right! Here is an example of such a solution: 1drv.ms/x/s!Agoi3ixeRLjuhT-0bH-TNx22Ui7Y?e=TneXNb
@excelemployeeleavetracker1274 Жыл бұрын
Great
@mohamedchakroun49737 жыл бұрын
Absolutelay Amazing Mike Thanks Youuuuuuuuuuuuuuuuuuuuuuuuuuuu
@excelisfun7 жыл бұрын
You are welcome!
@hosseinhosseinpoor95612 жыл бұрын
عالی
@automationguide34987 жыл бұрын
Thank You !!
@excelisfun7 жыл бұрын
You are welcome!
@Alexey07954 жыл бұрын
2:40 , 3:20 I am sure there is an advantage, but when should I choose "connection only"?
@excelisfun4 жыл бұрын
1) When they are sub queries that you will use in other queries and you do not want to load them to sheet, 2) When you are loading to Data Model.
@entertainmentgalaxy9717 жыл бұрын
Superb..:)
@zaighamuddinfarooqui17057 жыл бұрын
Excellent!!! :)
@excelisfun7 жыл бұрын
EXCELlent comment!!!!
@gustavopinto58639 күн бұрын
What about Rank 8 and 9?
@frederickhines4997 жыл бұрын
Hello Mike, I'm having some trouble building a spreadsheet that will transpose data from a column into row. But, I need the data to transpose to the next empty set of rows? Do you have any suggestions that I can use and/or any videos. I'm currently using MS Excel 2013 and 2016. Thank you for your consideration and help!! Thanks, Lynn
@excelisfun7 жыл бұрын
I do not know how to transpose data from a column to the next empty set of rows... : ( Maybe post question here: mrexcel.com/forum
@adamnewhall64167 жыл бұрын
I can't seem to login to the database. Is this my local problem or something up with the database? the error I get is: Details: "Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
@excelisfun7 жыл бұрын
I checked the database. It is working. I am not sure what is causing the error. I googled the error and saw a few different responses. Try Googling. If you resolve, please post back and tell us what was causing the error. It will help me and maybe others : )
@bharadhanenenu7 жыл бұрын
it's really cool.... could you please help me with excel 2013 how can we so this....
@excelisfun7 жыл бұрын
Have you downloaded and installed Power Query (free download) for Excel 2013? Also, there are many other ways to accomplish this without Power Query. Here is one: kzbin.info/www/bejne/m2WtmIyvp72toaM