Forum Discussion

ZvikaBK2801's avatar
ZvikaBK2801
Regular Visitor
1 month ago
Solved

Decimal Parameters in User Defined functions (UDF)

On their website, Microsoft defines decimal numbers as: "Decimal number is the most common number type, and can handle numbers with fractional values and whole numbers. Decimal number represents 64-...
  • v-achippa's avatar
    v-achippa
    1 month ago

    Hi ZvikaBK2801,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you avinash_7995 for the prompt response.

     

    This is expected. In a DAX UDF, the decimal type is a fixed decimal (currency) type that only keeps 4 decimal places, so 0.0045 / 230 rounds to 0.

    For calculations that require more than 4 decimal places, use the Double type instead, as it is designed for higher precision values.

     

    Thanks and regards,

    Anjan Kumar Chippa

  • ZvikaBK's avatar
    ZvikaBK
    1 month ago

    Hi, yes the solution had been provided thanks. I'm now using Double for all my non integer UDF parameters. I also notified the couple PBI local user groups about this issue.