Microsoft Power BI Cookbook
上QQ阅读APP看书,第一时间看更新

Use fixed decimal number for precision

  1. Convert Decimal Number to Fixed Decimal Number data types if consistent rounding results are required and the Fixed Decimal type provides sufficient size.
    • A Decimal data type is an approximate and can produce inconsistent reporting results due to rounding. Converting to a Fixed Decimal type provides 4 decimal places and ensures consistent results.
  2. Confirm that the scale of the Fixed Decimal type (19,4) will be sufficient before implementing this change.
  • In this example, the Measurement column is stored as a decimal number, but precise rounding (consistent results) is required:
Figure 149: Decimal Number data type
  • The query editor provides multiple indications of a decimal data type including the header icon and the Data Type dropdown in the toolbar.
Figure 150: Fixed decimal number type
  • The Fixed decimal number data type is equivalent to Currency in the M language as per Figure 151.
Figure 151: Conversion to Fixed decimal number data type