Forum Discussion

shephee's avatar
shephee
Frequent Visitor
3 years ago

PMT function in DAX

I am trying to utilize the PMT function in DAX with this formula: 

Monthy Payment = pmt(dim_loan[loan_interest_rate]/12,dim_loan[payment_months],dim_loan[loan_original_amount])

 

When I run it I get the following error message:  "An argument of function 'PMT' has the wrong data trype or the result is too large or too small".

 

I have been able to isolate which field is causing the error and that is the "dim_loan[payment_months]" field.  I am not sure why that is as this field is formatted as a whole number.  Any advice or help would be appreciated. 

 

As I am new with posting for help here, if there is any additional info needed please let me know.

4 Replies

    • shephee's avatar
      shephee
      Frequent Visitor

      There are no blanks values.  I checked and I see some 0's but I filtered those out and still have the issue.

      • v-yinliw-msft's avatar
        v-yinliw-msft
        Community Support

        Hi shephee ,

         

        You should Make sure that you are consistent about the units you use for specifying rate and nper.

        Rate is the first parameter and nper is the second parameter about the PMT function.

        If you make monthly payments on a four-year loan at an annual interest rate of 12 percent, use 0.12/12 for rate and 4*12 for nper.

        If you make annual payments on the same loan, use 0.12 for rate and 4 for nper.

         

        For more information, you can refer this documentation:

        PMT function (DAX) - DAX | Microsoft Learn

         

        Hope this helps you.

         

        Best Regards,

        Community Support Team _Yinliw

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • DanDeeGee's avatar
    DanDeeGee
    Regular Visitor

    Hi shephee!

     

    Did you ever find the answer as to why the dim_loan[payment_months] field (or anything else for that matter) was causing the issue?  I have just encountered this myslef and am tearing my hair out... and I have none!

     

    Thanks,

     

    Dan