MSPTDA 24: DAX Multiply / Divide Data Types Discrepancies Solved!

Поділитися
Вставка
  • Опубліковано 1 жов 2024
  • Download files:
    Start File: people.highlin...
    Finished File: people.highlin...
    pdf notes for Video #24: people.highlin...
    In this video learn about how different DAX Data Types can affect multiplication and division results and yield different answers depending on the order of the multiplication or division. This apparently violates the Commutative Property of Multiplication.
    Comprehensive Microsoft Power Tools for Data Analysis Class, BI 348, taught by Mike Girvin, Excel MVP and Highline College Professor.

КОМЕНТАРІ • 61

  • @GeertDelmulle
    @GeertDelmulle 5 років тому +5

    Dang, until 1 minute ago I used to be “precise” in my data type assigning.
    From now on it’s ‘decimal’ all the way until I reach the measure level.
    BTW: this remark only applies in the “currency vs. decimal” department.
    Thanks, Mike!

    • @excelisfun
      @excelisfun  5 років тому +2

      I like: Decimal all the way, until Measure : ) You are welcome, Geert!

    • @GeertDelmulle
      @GeertDelmulle 5 років тому

      BTW Mike, today I refined your reading ‘all files from folder’-trick by adding a Keyword-variable that I use to select only certain files (the ones where the file names contain the Keyword). That way I can restrict the number of files that are read/used in a workbook. Conversely, I don’t have to put all possible input files in separate folders for the workbook to work correctly.
      I find that a nice PQ-EMT. Maybe you can use that in one of your videos.

    • @excelisfun
      @excelisfun  5 років тому +1

      @@GeertDelmulle , wow!!! That really is cool : ) Power Query can do anything! Thanks for the trick, Geert!!!!

  • @masterof
    @masterof 5 років тому +3

    Thank you Mike - this one is important. I didn't know that will cause the results to be calculated differently. What is the benefit of using the Currency data type? In order to keep all the calculation precisely, should I use Decimal data type in all columns with numbers?

    • @masterof
      @masterof 5 років тому

      On the other hand, I remember I have seen it somewhere, but struggled to understand this: When I make a pivot table from the data model, the column total in the pivot table doesn't seem to be calculated correctly. I had to switch off the total in the pivot table and do a formula line to calculate the total instead. How to prevent/avoid this situation? Manually build a total line for pivot table isn't difficult, but it gets tricky in a pivot chart. Thank you Mike...

    • @excelisfun
      @excelisfun  5 років тому +2

      Yes, I think Decimal most of the time to keep precision is good and then use the formatting on the Measures or in the reports at the end. Unless the business calculation requires rounding at some points, like money often does for invoices, payroll and other, then we should manually round.

    • @excelisfun
      @excelisfun  5 років тому

      @@masterof There are 100s of reasons that the totals in a DAX Data Model PivotTable could be incorrect. We have to analyze that one situation at a time. It might be becasue of different Data Types and math, but it could be many other reasons also.

  • @katerina6495
    @katerina6495 5 років тому +4

    Thank you Mike, great video as always, have a great day

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome! It has been a good day! I hope you day is good too, Katerina : )

  • @chrism9037
    @chrism9037 5 років тому +2

    Thanks Mike!

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome, Chris Mancinelli!!!!

  • @DIGITAL_COOKING
    @DIGITAL_COOKING 5 років тому +2

    Awesome! Mike, great video, and I agree with Greet Delmulle about the usage of currency

    • @excelisfun
      @excelisfun  5 років тому +1

      Me too : ) Go Team!!!!!

  • @rrrprogram8667
    @rrrprogram8667 5 років тому +2

    Thanks for the tips mike

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome for the tip, RRR!

  • @simfinso858
    @simfinso858 5 років тому

    If I am making payments I will use Decimal & If I am Receiving money i will use currency.

  • @danjarupath
    @danjarupath 2 роки тому +1

    Awesome 👍👍👍👍😎😎😎😎

    • @excelisfun
      @excelisfun  2 роки тому

      Important oddity to know for sure : )

  • @shubhampawar8506
    @shubhampawar8506 3 роки тому

    Very minute detail ..thanks a lot ❤️

  • @SyedMuzammilMahasanShahi
    @SyedMuzammilMahasanShahi 5 років тому +2

    This is so awesome. Thanks Mike for this amazing video.

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome, Syed!!!!!

  • @HachiAdachi
    @HachiAdachi 5 років тому

    I have been under the notion that the use of currency data type would result in reduction in data size, so I have been quick to use the data type especially when working with a large dataset (usually in PQ). Now you make me wonder if the benefit of smaller data size (and maybe some performance improvement) is worth the cost of potential inaccuracy...

    • @excelisfun
      @excelisfun  5 років тому

      It all comes down to the precision of the calculation. Your idea of using Currency to reduce size, can reduce size, and if all the columns require up to 4 decimals, then that is fine! I like to manually round (ROUND or Number.Round) in accordance with the rules for each calculation...

  • @davidpellatt3501
    @davidpellatt3501 4 роки тому

    Hi Mike, To be honest I nearly always upload my data to Power Query and set the data types there before adding the data to the data Model. I then set the data type only within my DAX Measures. Regards.

    • @excelisfun
      @excelisfun  4 роки тому

      Thanks for the tip, David!

  • @joelngige5776
    @joelngige5776 3 роки тому

    Nice insights into how data types affects calculations. Thanks

    • @excelisfun
      @excelisfun  3 роки тому +1

      Glad it helps. Just use Decimal lol

  • @shubhampawar8506
    @shubhampawar8506 3 роки тому +1

    I will keep it all decimal

  • @hosseinhosseinpoor9561
    @hosseinhosseinpoor9561 2 роки тому

    top

  • @sumardjo
    @sumardjo 3 роки тому

    thanks information
    very clear
    thanks

    • @excelisfun
      @excelisfun  3 роки тому

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

  • @wayneedmondson1065
    @wayneedmondson1065 5 років тому

    Hi Mike.. GREAT video on this topic. Super solutions.. triple the fun! Going to get some more popcorn and watch this one again! Thumbs up!!

  • @ljubicar1987
    @ljubicar1987 4 роки тому

    The decimal is sure the safest option! I wouldn't guess the data type could be a reason for the difference in a million years! Thanks for sharing!

  • @MalinaC
    @MalinaC 5 років тому

    Wow, it is so important to use proper data type, great exaple. Thanks, Mike!

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome, Malina!!!

  • @stevennye5075
    @stevennye5075 5 років тому

    well done!

    • @excelisfun
      @excelisfun  5 років тому

      So much different than Number Formatting in Excel, right Steven Nye?

  • @wayneedmondson1065
    @wayneedmondson1065 5 років тому

    Hi Mike.. thanks for the great video and exposing the issue of data type and order of use in calculation. Kind of a booby trap hiding in plain sight. Thanks for sharing your wisdom. Thumbs up!

  • @jeffkasavan93
    @jeffkasavan93 4 роки тому

    Mike, thanks for the information. You make a valid "(decimal) point". :) :)

  • @joaquimcosta952
    @joaquimcosta952 5 років тому

    Uau.......

  • @davebowman5392
    @davebowman5392 5 років тому +2

    Thanks Mike

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome, Dave Bowman!!!!

  • @gentle2005phir
    @gentle2005phir 5 років тому

    Hope CDW will be >= WDC always, due to rounding up in C

    • @excelisfun
      @excelisfun  5 років тому

      I think that is correct, Gentle Raj!

  • @ndjanardhan
    @ndjanardhan 5 років тому

    Thanks you sir, for great tips about decimal

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome, Janardhan!!!!

  • @ogwalfrancis
    @ogwalfrancis 5 років тому

    Understanding decimal, Thanks Mike

    • @excelisfun
      @excelisfun  5 років тому +1

      You are welcome, Ogwal!!!!

  • @ismailismaili0071
    @ismailismaili0071 5 років тому

    thank you so so much for letting us pay attention to this issue.

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome, Ismail!!!!

  • @johnborg6005
    @johnborg6005 5 років тому

    That was great and interesting. Thanks Mike :)

    • @excelisfun
      @excelisfun  5 років тому

      You are welcome for the interesting, John Borg!!!

  • @mohamedchakroun4973
    @mohamedchakroun4973 5 років тому

    In this situation i stocks all data as a decimal :-)