SUMIF between 2 tables using Power Query

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

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

  • @laurabloom307
    @laurabloom307 2 года назад +3

    THANK YOU - I've been trying to find this for ages and your explanation was the only one that not only answered my problem but showed why step by step. Cannot wait to use this again and again, most helpful Power Query video I've seen yet.

  • @James-qr5mo
    @James-qr5mo 3 года назад +9

    This was exactly what I needed - thank you so much! Really clear instructions and building it up to the final thing, really helps!

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

    You are an excellent coder, teacher, and speaker. Thank you.

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

      Thank you for your beautiful words! 💚

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

    Outstanding! The way you teach, step-by-step, is the best way to build a solid understanding.

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

    I have watched so many videos trying to figure out how to do this, before I found this video. So well explained - thank you!!

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

    SUPER-LOVE your video, buddy!! the best part is that it carries not just a Wham-Bam solution, but a step-by-step explanation

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

    You are basically doing the most common part of SQL work in powerqeury! genius!

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

    that's one of the few times, were you look something up and get exactly what is needed, thanks a lot !

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

    Kudos to both you and the comments below.
    Interesting to watch your video and read the comments, It is one thing to find a solution but its another thing all together making file as light as possible whilst still getting the result.

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

    Dude, you're the best!! Been searching for this for like a month! Kudos my friend!

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

    WoW!!! What a nice video with its clear explanation. Thank you so much, and thanks to God that we have your dedication.

  •  Год назад

    What a beast!! great way of explaining! I mean, this looks difficult AF! but you explained it and is actually very easy!!

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

    This is absolute genius!! Thank you so much. So powerful, so well explained, powerquery is so versatile it is amazing

  • @AnuragMittal88
    @AnuragMittal88 Год назад +2

    This only works with small datasets, with large dataset it massively slows down the whole dashboard. Is there any way to do it similarly for larger datasets ?

  • @s.b.692
    @s.b.692 3 года назад

    Thank you for that explenation. It is a huge help for the Problem I had in PowerBI. Thank you so much.

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

    Very clear and concise explanation! Thanks for this great explanation.

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

    Thank you very much, in general very clear illustration step by step 👍👍. But I am still wondering how the formula definitely related the function name 'InnerTable' to the AllData table, not the Summary one. There is no clear definition to which table that the variable name 'InnerTable' is linked to. I would appreciate if you could explain more on this. Thanks in advance. 🌹🌹

  • @JB-hx3jr
    @JB-hx3jr Год назад

    Thanks!

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

    Such an instructive video! Really appreciated the detailed explanation with all the fundamentals. Thank you so much!

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

    Great solution and very well presented. The downside though it is extremely slow. I work on a file with 90,000 lines and it takes forever.

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

    You just make me smarter. Thanks for this extremely well-done and informative vid.

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

    Really excellent stuff this is Chandeep!!

  • @joaorataoo
    @joaorataoo 4 года назад

    Very clear and very well explanined.
    I'm gonna starting to following you.
    Thanks

  • @mariainesmorales2401
    @mariainesmorales2401 4 месяца назад

    You my friend are a genius!!!

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

    This guide is great , just what i needed to come further - thank you 🙂

  • @amneetbola6733
    @amneetbola6733 23 дня назад

    Jesus we never think like this until we actually see it happen. Thank you chandeep!

  • @beyourownboss_podcast
    @beyourownboss_podcast 6 месяцев назад

    Can this technique be used to get a value from another table instead of merge?

    • @GoodlyChandeep
      @GoodlyChandeep  6 месяцев назад

      I'll recommend a merge, they are faster.

  • @karthickudt9
    @karthickudt9 3 года назад +2

    Thanks. will it occupy more space? My Query as follows, Value.Divide(List.Sum(Table.SelectRows(
    UserSessionLog,
    (InnerTable) => InnerTable[Email]=[#"Email-ID"]
    )[TotalTimeSpent_Sec]),60)
    It is taking long time to execute. any suggestion on this query.

    • @md.raselhossain964
      @md.raselhossain964 2 года назад +1

      same thing happened in myside, its take long time. Any suggestion ?

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

    I have been looking for this exact thing... Thank you so much for creating this. It helped me in crunch time!

  • @visheshvyas8606
    @visheshvyas8606 7 месяцев назад

    Thank you very much, it's amazing and very helpful. One question though, it has made the loading data really really slow, I mean earlier it used to take 10-15 seconds that now takes almost 5-6 minutes. that too only for 9k rows. Is there any workaround to make data load faster?

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

    Thanks. Very well explained! I will try this on my data which has a lot more conditions but I’ll give it a go.

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

    Hey thanks for sharing this video it’s quite impressive. I just wonder how to use the inner table do you have other sample for the inner table that I can reference to

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

    This trick is helpful. I get it that it is inefficient with large / voluminous data. But if I had to do it with a smaller set and needed sum of multiple columns - what would be the additional steps. I do intend to experiment with the group by option and then aggregate suggested Bart Titulear (thanks to Bart also), but it would be helpful to understand the steps

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

    Thanks Chandeep
    But there is one question, if there are more than 2 table then how we can assign for a particular table? That time AllTable will pickup the required table??

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

    Amazing solution, thank you so much. I just love the way you explain things

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

    Wasn't there a Merge option available at that time? Using the merge and aggregation option is much faster.

    • @visheshvyas8606
      @visheshvyas8606 7 месяцев назад

      How do you sum using conditions in merge option??

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

    Brilliant- can see myself using this a lot. Very helpful, thank you

  • @sagarmathur-i4p
    @sagarmathur-i4p Год назад

    hi chandeep..thanks for making this videro... here i have one Query i am not sure whther i am wrong or right but when you write a code for filter , then how does filter picks only "A" and location "East " however nothing is mention in code ..... you just write an equation inner table(location)=(location)... how is this working on only east location ?

  • @rameshkandi
    @rameshkandi 4 года назад

    Kudos to your way of explanation 🙏

  • @cameron9134
    @cameron9134 7 месяцев назад

    Thanks for the super clear explanation! I have been searching in many videos about this issue I have, and luckily I found this video. And just clicked Subscribed :). Btw I have one issue, if the master data table has Guys A, B, C, D, E, but in the transaction table only has names A, B, C, D, then the result in Guys E will be "null". How to replace this "null" becomes 0 (zero) ?

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

    Excellent explanation 💯👍

  • @KatyaKing-rx6mp
    @KatyaKing-rx6mp 2 года назад +1

    Thanks for the great video, the formula is awesome. However, with having over 5k rows in both tables the power query is taking a very looong time to refresh. Is there another alternative that would calculate results quicker?

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

    How can i use it between 2 date
    And want to know countifs too .

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

    I seem to be having an issue with power query recognizing the "inner table" it is putting #"AllTable" around the name of the table. Could this be the issue? Not sure why it is not recognizing the inner table

  • @cyclingmc
    @cyclingmc 4 года назад +1

    I have a data set of 22k rows and this slows down my machine a lot. 22k rows is not a lot for power query. I removed all other columns expect for 3 columns with 22k+ rows. I can’t think of a reason why this is so slow to query results.. any idea?? Thanks!

  • @aahanavikram07
    @aahanavikram07 4 года назад

    I waited this for a long time..
    Thanks for the video 🙏👍

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

    It is very good explained and it works. Only one thing¨/question. For bigger dataset it takes a lot of time. Is there any other faster posibility? Thanks

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

    is there any way to do this but rather than a sum to instead have a median, average, min, max. is there a comparable list.sum for these other functions?

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

    Another great video! Need to get your course once I've saved up some money!

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

      Awesome, thank you!

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

      @@GoodlyChandeep No, thank you for the awesome content good sir! Keep it coming!

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

    You sir, are a legend. Thank you for this

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

    How to use sumproduct in power query

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

    Great content buddy.. keep going!

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

    Great examples thank you! I was working with similar scenario of part and inventory locations. much better solution than mine!

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

    Is there any limitations of data as i am trying with 2 lakh line item working very slow please advise

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

    Really you r so fantastic thx alot and go on with power Query

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

    Thanks for the step by step explanation!!
    Though I personally found that variable part quite tricky (as in the process by which you declare a variable in M.).

    • @GoodlyChandeep
      @GoodlyChandeep  4 года назад +2

      Hey Smit,
      I understand variables especially when used with functions can be slightly tricky to understand, especially due to it's tricky syntax.
      I too, took a while to understand and I am still exploring them :D Perhaps I can make a few vids on M language basics.
      Cheers!

    • @DhruvDua88
      @DhruvDua88 4 года назад

      @@GoodlyChandeep Hi this was a very comprehensive video and the method you used is ingenious. Please do make a video on the M language basics.

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

      @@GoodlyChandeep how to do sumif if you extract the data from a csv file.

    • @ivancuadros8731
      @ivancuadros8731 4 дня назад

      ⁠@@GoodlyChandeep i still dont understand how simple porque assumes the variable just by adding the [Name], how does it understand the table is that column, what is there is another column with tables with a column called Name

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

    Exactly what I was looking to, Ive been working with keys to bring up values from other tables, but this wraps it up in few lines of code. Can you give us an example with sum.ifs into nested ifs? Thank you so much.

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

    Can it be a measure instead and result like this thamkyouuu

  • @SanjaySingh-i5u
    @SanjaySingh-i5u Год назад

    When I type the codes, I don't get illustrations (pop up box) , how to enable?

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

    Sir, Inbuilt M functions are not highlighted when we try to use them, please help with this

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

    How well does this scale? I have 2 tables with 20k and 40 k rows. I am patiently waiting for the load?

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

      I've found it can massively improve performance if you buffer the "inner" table first, outside of the Table.AddColumn function, and then reference that rather than the actual query itself, as that means it'll only be refreshed once (rather than once for every row of the table you're adding the column to). So for this example in the advanced editor for the step I would do something like:
      sumif =
      let buffer = Table.Buffer(AllTable)
      in Table.AddColumn(Source, "SUMIF", each List.Sum(Table.SelectRows(buffer, (InnerTable) => InnerTable[Names] = [Guys] and InnerTable[Location] = [Location])[Value]))
      Obviously buffering depends on having sufficient memory, and it'll break query folding, but where those aren't considerations it sped up my aggregations a lot.

  • @yosef-yosef9414
    @yosef-yosef9414 3 года назад

    thank you for this video, i will review it again.. I am not used to creating formulas in Power Query, it's very new to me ... 😩
    But thanks again

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

    Date column suppose to calculate greater or less than in two tables sir

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

    Hi, I know it's been a while since you posted the video, but I wondered if what I needed was just a unique value and I didn't have to sum anything?

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

    C est expliqué si bien
    Respect

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

    Once giving variable inner table getting an error insert able wasn't recognized ?

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

    How do I add another SUMIF Column if I want to bring in 2 value columns from another table? I tried to copy the steps but it only seems to flip back and forth from the sum of 1 column at a time.

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

    Thank you Sir, I have applied it in my model. However, it gave me the below message "Expression.Error: The column 'value' of the table wasn't found.
    Details:
    value" can you please advide?

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

    Beautiful explanation!

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

    How to do sumif when u extract the data from a csv file brother. Please help.

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

    Great trick!! I wonder how to apply with multiple value like value, value1, value2, ... , value n

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

    Simple and GREAT. THANK YOU 😀

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

    How can we do a recursive . I have a table with employee and manager. I am trying to get a list of all employees working for a manager. There could be multi level. Thanks in advance for your help. Your videos are awesome

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

    Hi! I'm very fresh in Power BT, so, sorry for the stupid question... I it possible to make a column filed with "others" in this example? I.e.: bringing "east" totals and summing all others with "others" instead of the region name?

  • @rudyagus1209
    @rudyagus1209 4 года назад

    outstanding explanation, thank you

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

    How can I make it based on if cell contains text from summary table??

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

    what is the purpose of creating variable? why cant we directly refer table instead of innertable variable?

  • @vacilando86
    @vacilando86 4 года назад

    It's very useful trick , thanks

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

    How can I activate formurla suggestion pop-up? I'm using excel 2016

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

    extremely helpful! thanks for sharing

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

    awesome tutorial.. thanks

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

    Thank you for your video and solution. I have a question. I used this method and added if statement in query but I got error message while there was no error in syntax.
    Query :
    Table.SelectRows(
    #"Crosstab1",
    (InnerTable)=>
    (
    (each if [AAA] = "" then "" else InnerTable[FFF]) &
    (each if [BBB] = "" then "" else InnerTable[GGG]) & (each if [CCC] = "" then "" else InnerTable[HHH])
    ) =
    ([AAA] & [BBB] & [CCC])
    )
    Error :
    Expression.Error: We cannot apply operator & to types Function and Function.
    Details:
    Operator=&
    Left=[Function]
    Right=[Function]

  • @syedtahirbukhari8377
    @syedtahirbukhari8377 3 месяца назад

    You r very Good in M code.....but the thing is you went directly there without touching the basic how to upload transform add column group by relationship tables you have to teach them very basic then move to M code 😅 if we know basic and now we learn M very easily it comes with Ai and chat gpt

  • @juansepowerplatform
    @juansepowerplatform 4 года назад

    Thank you, this is exactly what I needed. Regards.

  • @barttitulaerexcelbart9400
    @barttitulaerexcelbart9400 4 года назад +2

    Hello mister. I follow your video's quite some time and you explain very well. I learn a lot from you, thank you. But in this video I was supprised. Why come up with such a difficult solution.? You can merge the two tables by selecting one after another two collumns. and then not expand but aggregate. Here is the code (I only used the GUI, no editting 😉) , I later renamed my table1 and table2 to tbl_large and tbl_small:
    let
    Source = Table.NestedJoin(Table2, {"Guys", "Location"}, Tbl_large, {"names", "Location"}, "Table1", JoinKind.LeftOuter),
    #"Aggregated Table1" = Table.AggregateTableColumn(Source, "Table1", {{"Value", List.Sum, "Sum of Value"}})
    in
    #"Aggregated Table1"

    • @GoodlyChandeep
      @GoodlyChandeep  4 года назад

      Hi Bart, thanks for the feedback.
      In my experience merges often slow down the queries, hence that painful formula :-|

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

    How do you do to see those options pop when you are writing? I have to write the complete code without options, is there something to activate it?

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

      Update your Excel

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

      Get Data > Query Options > Power Query Editor > Formula, check box for Enable M Intellisense...

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

    Thank you so much! It was very helpful and this is exactly what I needed.

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

      Be cautious of the performance! It tends to be very slow on Large Data

  • @Pmo125
    @Pmo125 4 месяца назад

    What if it’s not returning the matching value, but instead returning another one?

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

    Hi Bro, this was a great video. However, when I try to select the column of the first table I get an error of syntaxis... but it is right spelt..

  • @Arunkumar-ky9cd
    @Arunkumar-ky9cd 3 года назад

    Mm from my understanding SUMIF is quite easy in Power BI but do we have anything for SUMIFS in Power BI, What I mean instead of one condition if we have multiple condition

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

    voilà Chandeep 😎 👏

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

    hi,
    can you show how one can add two columns of data that are saved in two separate tables?
    for example, Table 1 contains the values 10, 20, 30.
    table 2 contains 100, 200, 300.
    I want to see the result 110, 220, 330, preferably in its own table or a as a separate column within table 1 or table 2.
    thanks

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

    awesome power query trick

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

    why did you declare a variable called inner function? why not reference the last step?

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

    It doesnt work if you get the grab the data from Sharepoint. Please help.

  • @Sri-Nivas
    @Sri-Nivas 4 года назад

    Cool way of explanation.. Can we do all formula's and functions with in power query?

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

    Sir how to add date criteria adding another date table

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

    This is just crazy cool, dude!
    Thank you! :)

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

    Custom Column was so cool....

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

    I got to the second lookup and it states "This Table is empty". Why is that?
    =Table.SelectRows(
    #"Prior POG",
    (InnerTable) => InnerTable[DIV STORE] = [DIV STORE] and
    InnerTable[UPC] = [UPC]
    )