MSPTDA 23: Two Fact Tables? DAX, Power Query or Worksheet Formulas to Convert to 1 Fact Table

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ธ.ค. 2024

ความคิดเห็น • 112

  • @excelisfun
    @excelisfun  5 ปีที่แล้ว +6

    Topics:
    1. (00:16) Introduction
    2. (02:35) Excel Worksheet Formula Solution
    3. (05:01) How do we allocate Discount from Invoice Grain to Invoice Line Grain?
    4. (05:45) Worksheet Formula for Total Invoice Sales at Invoice Grain using SUMPRODUCT function
    5. (09:23) Worksheet Formula for % Sales Discount at Invoice Grain using division
    6. (10:00) Worksheet Formula for Line Discount at Invoice Line Grain using VLOOKUP and multiplication
    7. (12:12) How do we allocate Shipping from Invoice Grain to Invoice Line Grain?
    8. (13:27) Worksheet Formula for Invoice Line Shipping Weight at Invoice Line Grain using VLOOKUP and multiplication
    9. (14:30) Worksheet Formula for Invoice Weight at Invoice Grain using SUMIFS
    10. (15:04) Worksheet Formula for Line Shipping at Invoice Line Grain using VLOOKUP and multiplication
    11. (16:50) Create Excel Reports at Product Grain.
    12. (17:03) Standard PivotTable Report
    13. (17:53) Worksheet Formula Report
    14. (21:26) DAX Formula Solution in Power Pivot
    15. (22:30) Look at Data Model and preview of DAX Formulas and functions SUMX, RELATED and RELATEDTABLE
    16. (24:30) Bring Excel Tables into Data Model
    17. (25:15) Create Relationships between tables
    18. (26:23) How to Allocate Invoice Grain Numbers to Invoice Line Grain Numbers
    19. (26:56) DAX Formula for Total Invoice Sales at Invoice Grain using SUMX and RELATEDTABLE functions
    20. (29:40) DAX Formula for % Sales Discount at Invoice Grain using DIVIDE function
    21. (30:50) DAX Formula for Line Discount at Invoice Line Grain using RELATED function and multiplication
    22. (31:57) DAX Measure for Total Discount
    23. (32:39) Data Model PivotTable Report for Product Discount
    24. (33:08) How do we allocate Shipping from Invoice Grain to Invoice Line Grain?+
    25. (34:22) DAX Formula for Invoice Weight at Invoice Grain using SUMX, RELATEDTABLE and RELATED.
    26. (35:56) Visuals to understand how DAX Formula with SUMX, REALTEDTABLE and RELATED are working to traverse multiple relationships in one formula. This helps illustrates the Power of DAX for Business Calculations.
    27. (36:52) DAX Formula for Line Shipping at Invoice Line Grain using RELATED and multiplication and division. Three RELATED function in one formula
    28. (39:03) DAX Measure for Total Shipping
    29. (39:25) Final Data Model PivotTable
    30. (40:22) Power Query Solution in Power BI Desktop
    31. (41:09) Why Two Fact Tables will not work with all Dimension Tables for Reporting.
    32. (43:05) Summary and visuals of steps we need to perform
    33. (44:12) Create blank Power BI Desktop file
    34. (44:40) Import Two Fact Table Data Model from Power Pivot
    35. (45:40) Power Query Formula to calculate Sales at Invoice Line Grain using Table.AddColumn function
    36. (46:53) Power Query Merge to lookup Product Weight at Invoice Line Grain
    37. (47:26) Power Query Formula to calculate Product Shipping Weight at Invoice Line Grain using Table.AddColumn function
    38. (47:42) Power Query Group By feature to aggregate Invoice Sales, Invoice Shipping Weight and all rows in Invoice Line Grain Table for each Invoice Number.
    39. (49:52) Power Query Merge to pull Invoice Grain Shipping & Discount numbers, as well as to pull the Invoice Level Dimensions of Date and Sales Rep ID into the current step in the query (later after expanding it will be the Invoice Line Grain).
    40. (50:52) Power Query Formula for % Sales Discount at Invoice Grain using Table.AddColumn function
    41. (52:11) Expand to get back to Invoice Line Grain
    42. (52:31) Note about Unit Price and how it is stored as a Fact because it changes so often.
    43. (54:16) Power Query Formula for Line Discount at Invoice Line Grain using Table.AddColumn function and Number.Round
    44. (54:49) Power Query Formula for Line Shipping at Invoice Line Grain using Custom Column using Table.AddColumn function and Number.Round
    45. (57:23) Remove all column we do not need in final Fact Table
    46. (58:08) Load Tables to Data Model, except Invoice Level Table.
    47. (59:15) Create DAX Measures for Shipping, Discounts and Sales
    48. (01:00:10) Create % DAX Measures for Shipping and Discount as a percent of sales. Use the DIVIDE DAX Function.
    49. (01:01:15) Hide Columns from Report View
    50. (01:01:33) Look at Final Data Model
    51. (01:01:47) Create Visualization in Power BI Desktop
    52. (01:04:40) Summary

  • @joesmith4254
    @joesmith4254 5 หลายเดือนก่อน +1

    Thanks, brilliant tutorial as always from you.
    Fun to see that you have picked up new habits in the newer videos, ie. naming steps in Power Query without spaces and so you can tell what the step is doing.

    • @excelisfun
      @excelisfun  5 หลายเดือนก่อน

      Yup, as time goes no we keep learning : ) This trick is in my new M Code book coming out in one month.

  • @waiyanminsoe4982
    @waiyanminsoe4982 ปีที่แล้ว +1

    Hay I would like to thanks the author for passing my microsoft pl 300 exam. Although this course isn't aimed for pl-300 exam, this author and his videos definitely helped me to get started on power bi journey . Please continue to post amazing contents and I would like to learn more from you and thank you so much !!

    • @excelisfun
      @excelisfun  ปีที่แล้ว +1

      Congrats on passing!!! Here is video that shows the different classes and videos that I provide for free at TH-cam:
      th-cam.com/video/GNhN1Zw8oM0/w-d-xo.html

  • @maksim0933
    @maksim0933 2 ปีที่แล้ว +1

    God save this man, who teach the people, and helping us significant!😃

    • @excelisfun
      @excelisfun  2 ปีที่แล้ว

      I am happy to help you, Maksim!!!!

  • @phorton968
    @phorton968 2 ปีที่แล้ว +1

    Absolutely Brilliant! Power Query example was a home run. Thanks....

    • @excelisfun
      @excelisfun  2 ปีที่แล้ว

      Glad you like it!

  • @GeertDelmulle
    @GeertDelmulle 5 ปีที่แล้ว +3

    Thanks Mike for repeating these videos, merging them into one lesson and integrating all of it into the MSPTDA class.
    They fit nicely in this course, and it was necessary to watch them again.
    BTW: I explain the DAX formulas to myself in terms of Context and Context Type (row/filter), which is just a little different than the way you explained it, but (of course) it boils down to the exact same thing. Just to practice the DAX way of thinking.
    See you on the next one!

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      I like the way you think! Thinking in DAX so so much different then in Worksheet Formulas or Power Query, in a good way : ) Thanks for your support, Geert!

    • @GeertDelmulle
      @GeertDelmulle 5 ปีที่แล้ว +1

      Mike, the other day in Excel Classic, I was writing a formula and I wrote it from a DAX-perspective: it gives you a new way of thinking about the old stuff. The formula was this: =MAX(LEN(SomeRange)). It’s a single cell calculation (and we like that kind of stuff!) and I really saw it as an aggregator on a dynamically (and in-cell) constructed range (column). Two things/aspects I learned from the DAX environment.
      Of(f) course, I still need CTRL+SHIFT+ENTER, but still: in the past I would have used a helper column.
      BTW, I know: it’s a known Excel technique called “lifting”, but still: it makes for a powerful, compact and efficient workbook (and a lot of jaws dropping on the floor when people ask me to ‘mildly’ explain it :-). They always say the same: “they thought they knew Excel, but they didn’t know “this” “. (Where “this” is a variable). Yeah, well: whatever gets the job done, right? :-)
      (Single cell computations yield very elegant spreadsheets :-)

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      @@GeertDelmulle Love that story, Geert!!!! Yes, Single Cell, whether conceptualized in Worksheet or DAX, is still awesome!!! Thanks for being so smart with Excel and treating the people at your work with fun surprises : )

  • @celia5132
    @celia5132 4 ปีที่แล้ว

    I just started watching the video but I wanted to thank you first for such an informative and clear educational video! I really appreciate your time and effort for putting together the guides.

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      You are we4lcome, Celia : )

  • @jeffkasavan93
    @jeffkasavan93 4 ปีที่แล้ว +2

    Well, In the written instructions, I see you DID say to import the data model from the Excel sheet. Nice!

  • @SyedMuzammilMahasanShahi
    @SyedMuzammilMahasanShahi 5 ปีที่แล้ว +4

    Man this is intense. I'm loving it. Thanks Mike for the share.

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      You are welcome for the share, Syed!!!! Thanks for the amazing support you give!!!

  • @niavras
    @niavras 4 ปีที่แล้ว +1

    I am really impressed by the quality of your work! Amazing tutorial!!!

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      Glad it is amazing for you, kostas! Thank you for your support : )

  • @shubhampawar8506
    @shubhampawar8506 3 ปีที่แล้ว +1

    Related and relatable is awesome 👌..you have given 3 ways to solve that problem ..I like the third one ...by creating star schema model in BI ...thanks a lot ❤️

    • @excelisfun
      @excelisfun  3 ปีที่แล้ว

      Yes, sir!!! Me too. RELATEDTABLE is just so beautiful : ) : )

  • @jasontan4730
    @jasontan4730 5 ปีที่แล้ว

    Awesome tutorial 👍👍👍. I tend to get confused when switching between Excel and DAX. But this video really helps to call out the difference . Millions thanks Mike 👍😁😁

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      Million you are welcomes!!! My specialty is linking DAX, Data Model and Power Query between Excel, Excel Power Pivot and Power BI : )

  • @anthonyaroni5530
    @anthonyaroni5530 4 ปีที่แล้ว +1

    The 2nd part of this video was absolutely amazing! I need to fix a couple of my models after learning that. Thanks!!

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      Glad you like it!

  • @johnborg6005
    @johnborg6005 5 ปีที่แล้ว +1

    After a very hard working week, this was great fun !!!! Thanks Mike. :)

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      Sorry about your hard work week! Glad this provided some fun, John Borg!!!

  • @ismailismaili0071
    @ismailismaili0071 5 ปีที่แล้ว +5

    I’m so glad to be the first to comment and like the video Mr. Mike you are always the best

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      I should give you a first place trophy : ) : ) Thanks for the "first" support, Ismail!

  • @shoeshines2121
    @shoeshines2121 4 ปีที่แล้ว

    This was an awesome video with the 3 different methods to solving this problem. Great tutorial!

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      Glad you like it, TP : )

  • @chrism9037
    @chrism9037 5 ปีที่แล้ว +4

    Amazing video Mike!!

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      Thanks for the comment and support, Chris Mancinelli!!!!

  • @Levelworm
    @Levelworm 5 ปีที่แล้ว +4

    Thanks for the video. I actually see a lot of this kind of layouts in DWH design. It is called "header-detail" design if I'm not mistaken. Kimball thinks this is a bad design but I guess people use it a lot.

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +4

      You are welcome, Levelword! Yes, Kimball and Header-Detail... that is why the names of the Excel Tables in this example where Header and Detail ; ). It makes sense that people store data this way because the shipping and discount ARE "whole" Invoice numbers, and the units and price ARE whole product line numbers, but then it is incumbent of us, data modelers or data warehousers, to have a little fun allocating : )

  • @knikl
    @knikl 4 ปีที่แล้ว

    Another awesome lesson, thank you so much Mike.

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      You are welcome!

  • @keishrich
    @keishrich 5 ปีที่แล้ว +1

    Now I know how to lock a cell in an Excel table. Thank you :)

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      Glad you found one of the small details in the video that was helpful, Keisha! Thanks for watching and thanks for your support!

  • @DIGITAL_COOKING
    @DIGITAL_COOKING 5 ปีที่แล้ว

    Now I think no one will choose methods other than the third one, great video mike for data modeling..and don't forget to check your power bi desktop it's said that there is a new update :)

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      Yes, I like the Power Query Method also, but the DAX formulas are amazing : ) Thanks for the reminder about updating my Power BI - you are smartly observant!

  • @clalgbarros
    @clalgbarros 4 ปีที่แล้ว

    This video is one of the best. Congatulations!!!

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      Glad it helps : )

  • @johnborg6005
    @johnborg6005 5 ปีที่แล้ว

    B/fast on new year's day. Happy new year mike, i wish you and all your followers on yr channel more fun with yr coming videos. :) :)

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      Perfect breakfast for new years days: 2 Fact Tables form the excelisfun restaurant : ) : )

  • @ogwalfrancis
    @ogwalfrancis 5 ปีที่แล้ว +1

    Awesome video, thank you so much Mike

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      You are welcome, Ogwal!!

  • @sallyg5hlee636
    @sallyg5hlee636 5 ปีที่แล้ว +2

    A common problem solved, thank you!

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      You are welcome, Sally Lee! Thanks for your uncommon support : )

  • @sumardjo
    @sumardjo 3 ปีที่แล้ว

    thanks for all
    the files sample is very easy to learn
    thanks very much
    thnaks

    • @excelisfun
      @excelisfun  3 ปีที่แล้ว

      You are welcome - by now you should be getting to be an Excel Data Analysis Master, Rusdi : ) : )

  • @MalinaC
    @MalinaC 5 ปีที่แล้ว +1

    Oh, it's nice that VLOOKUP locked the lookup table :)

  • @khaledibrahim5268
    @khaledibrahim5268 5 ปีที่แล้ว +1

    wonderful thanks for the way and the good steps to learn

  • @davebowman5392
    @davebowman5392 5 ปีที่แล้ว +3

    Thanks Mike!

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      You are welcome, Dave! Thanks for your consistent support : )

  • @jeffkasavan93
    @jeffkasavan93 4 ปีที่แล้ว +1

    Thanks for the eye-opening lesson. In the Power BI segment, I used Import to transfer the data model from the Excel file into the Power BI file. Is that a method that you go over later in the MSPTDA series?

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว +1

      You know, I thought I taught it in MSPTDA #17, but I just looked and it is not there!?!?!?! I guess I did only there very minimum by including it in one line in the pdf notes : (
      It is great to know when you already have Data Model in Excel. Then you can have the best of both worlds, Excel Data Model PivotTable, then bring Data Model over to Power BI for some publishable interactive visuals !!!

  • @pollora6233
    @pollora6233 4 ปีที่แล้ว

    thanks again for this material.

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      You are welcome!

  • @guyllaumedemers401
    @guyllaumedemers401 ปีที่แล้ว

    What's the most efficient way to do it for the computer (Power Pivot VS Power Query)?

  • @kebincui
    @kebincui 2 ปีที่แล้ว

    Top👍👍👍

    • @excelisfun
      @excelisfun  2 ปีที่แล้ว

      Glad you like it!!!!

  • @daisonduchemajaya1326
    @daisonduchemajaya1326 5 ปีที่แล้ว +1

    Thank you for your great selfless.
    I have a sales table and a budget table for a network of stores. I need to create a relationship between the two tables so that I can be able to see both budget and actual sales per month per store but the relationship just can't happen. May you please assist?

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      I will post a video next week on this topic : )

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      You aer welcome for the resources. Thanks for your support, Daison!!!!

  • @jolieken5630
    @jolieken5630 2 ปีที่แล้ว

    Awesome Video from the MVP. Thanks so much. I have a congestion with DAX when doing the same formula what you did with DAX in this Video, I don't know why. Excel tell that they have errors with Invoice Sales. The errors disappear then it returns right values if I refresh all. However, I try to refresh first then typing formula, the errors still happen until I take refresh all again. Could you tell me the reason ?

  • @markosiridzanski2181
    @markosiridzanski2181 2 ปีที่แล้ว

    I am used to using CALCULATE wherever I need context transition. In the case of pulling in gross sales amount in fInvoiceHeader, firstly I created Total Sales Column in LineItmes Table, and dragged it as CALCULATE(SUM(fLineItemInvoiceDetail[Total Sales])). Is there any drawback compared to relatedtable solution?

  • @mohitmanwani5298
    @mohitmanwani5298 4 ปีที่แล้ว

    Transforming Excel people to think like DAX!! BANG ON....Most importantly we should have Star Schema rather than Snowflake!!

  • @williamarthur4801
    @williamarthur4801 2 ปีที่แล้ว

    Just out of interest I noticed that in the excel sumif formula where you lock the structured reference for criteria range, but for criteria itself you used the locked cell reference,
    is it possible to absolute @[Product] , I've tried every which way I can think of.

    • @excelisfun
      @excelisfun  2 ปีที่แล้ว

      Maybe INDEX([Product],1) if it was the first cell.

  • @NoShadowOfDoubt1
    @NoShadowOfDoubt1 5 ปีที่แล้ว +1

    Can I say how awesome the PDF download is? thank you Mike!

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +2

      Yes you can!!! You are welcome... I hope you have seen some of the other pdf notes too : )

  • @AJuresic
    @AJuresic 4 ปีที่แล้ว

    Good work!

  • @AhmedAbdalalim
    @AhmedAbdalalim 5 ปีที่แล้ว +1

    Nice one
    Thanks

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      You are welcome!

  • @mrexcel173
    @mrexcel173 5 ปีที่แล้ว

    Hello Mr Mike i have one question can u plz help me out..
    I wana simply sumif values on merged cells..
    Like i have data A2:B20.. A2:A20 is criteria range where some names are merged and B2:B20 is sum range.. I wanna sumif the values based on criteria where some cells are merged. When am trying to do this its giving the only sum of first value of each merged cells.

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      I have no idea how to do that. Merged cells are usually not a good idea because they cause trouble in many different ways.

    • @mrexcel173
      @mrexcel173 5 ปีที่แล้ว

      @@excelisfun thanks for replying.

    • @mrexcel173
      @mrexcel173 5 ปีที่แล้ว

      @@excelisfun Buy the way u r realy good instructor, ur teaching mathod is very easy and clear.. I appreciate your struggle..

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      @@mrexcel173 , Thanks! I appreciate your support on each video : )

  • @briandennehy6380
    @briandennehy6380 5 ปีที่แล้ว

    Mike amazing video as always!
    Quick question for you and any viewers of the channel. Is there a shortcut key to jump you back to a sheet when you a doing a formula that references multiple worksheets?
    So I'm doing a countifs on sheet 2 that references a range on sheet 1 as one of my criteria range. When I go and select this range on sheet 1 is there a shortcut key that takes me back to the formula on sheet 2?

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      To jump back to a Precedent Cell, try Ctrl + [

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      To jump to a Dependent Cell, try Ctrl + ]

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      Glad you like the video, Brain! Thanks for your support with your comments, Thumbs Ups and Sub : )

    • @briandennehy6380
      @briandennehy6380 5 ปีที่แล้ว

      @@excelisfun Thanks so much Mike,, you da man!!

  • @Wasifali302
    @Wasifali302 5 ปีที่แล้ว

    when i try to use Group by it gives an errors,,, specifically when i added last aggregation.,,,for all records...Can you tell what i am doing wrong? Greatful

  • @nasnooka
    @nasnooka 5 ปีที่แล้ว

    Anyone know how to change all the dates in cells by updating in just first cell?

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      It depends on how you want all the dates to change.

    • @nasnooka
      @nasnooka 5 ปีที่แล้ว

      ExcelIsFun I need all the dates in sequence i.e from 5/1/2019 to 5/31/2019, so when change date in first cell all dates need to change automatically. If you have any video please share link.

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      @@nasnooka If First Date is in cell A1, then just use formula like =A1+1, then copy down : )

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      Do you like the videos?

    • @nasnooka
      @nasnooka 5 ปีที่แล้ว

      ExcelIsFun I been watching you from long time. Learn lots of new things.
      Thanks it works.

  • @anthonyaroni5530
    @anthonyaroni5530 4 ปีที่แล้ว

    Do you prefer using DAX or Power Query on this issue? I've been using Power Query but it seems that the DAX way is better. What do you think?

    • @excelisfun
      @excelisfun  4 ปีที่แล้ว

      DAX is often faster.

  • @dragjj
    @dragjj 3 ปีที่แล้ว

    links are dead :(

  • @AbhisheakSaraswat
    @AbhisheakSaraswat 5 ปีที่แล้ว

    Plz make videos on excel dashboard

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว +1

      I have so many videos on that topic... Here is a playlist about dashboards, where you can choose what video to watch: th-cam.com/play/PLrRPvpgDmw0kYt4c50Sg7BXGLBAjiW6VQ.html , maybe the "Highline Class #17" video (3rd in playlist) or (E-DAB #8 video #15 in the playlist).
      Please help support this free resource, Abhishek, with your comments and thumbs ups on each video and your Sub : )

    • @AbhisheakSaraswat
      @AbhisheakSaraswat 5 ปีที่แล้ว

      Hi Girvin, I want only in excel, in some office only use of Ms excel in place of power bi,

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      @@AbhisheakSaraswat As I said in previous videos, there at least two good videos for you : )

    • @AbhisheakSaraswat
      @AbhisheakSaraswat 5 ปีที่แล้ว

      @@excelisfun which one, if you don't mind plz share that link, it would be great for me. Your help really appreciated.

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      @@AbhisheakSaraswat I already posted it above!!!

  • @NoShadowOfDoubt1
    @NoShadowOfDoubt1 5 ปีที่แล้ว +1

    Warning! No popcorn! ...

    • @excelisfun
      @excelisfun  5 ปีที่แล้ว

      Niiiiiiiiiiiiiice!!! : )

  • @hosseinhosseinpoor9561
    @hosseinhosseinpoor9561 2 ปีที่แล้ว

    top