Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gutts_Zero
Frequent Visitor

ipmt and ppmt calculation has wrong data type or the result is too large/small

Was following a youtube video on PPMT and IPMT functions but encountered this error and don't know how to fix it.

 

Gutts_Zero_0-1689490820297.png

Link to file 

1 ACCEPTED SOLUTION

Hi  @Gutts_Zero ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create measures.

Measure = var _a=CALCULATE(MAX('Fact'[Period]),FILTER(ALL('Fact'),'Fact'[Period]=MAX('Fact'[Period]))) return IF([Is within Period]=0,1,_a)
ipmt = ipmt(0.06/12,[Measure],'Loan Period'[Loan Period Value]*12,200000,0,0)

(2) Then the result is as follows.

 vtangjiemsft_2-1689650920312.png

 

Best Regards,

Neeko Tang

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

View solution in original post

3 REPLIES 3
Gutts_Zero
Frequent Visitor

Hello, 

 

Hello,

 

Link to the sample file 

Hi  @Gutts_Zero ,

 

According to your description, here are my steps you can follow as a solution.

(1) We can create measures.

Measure = var _a=CALCULATE(MAX('Fact'[Period]),FILTER(ALL('Fact'),'Fact'[Period]=MAX('Fact'[Period]))) return IF([Is within Period]=0,1,_a)
ipmt = ipmt(0.06/12,[Measure],'Loan Period'[Loan Period Value]*12,200000,0,0)

(2) Then the result is as follows.

 vtangjiemsft_2-1689650920312.png

 

Best Regards,

Neeko Tang

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

v-tangjie-msft
Community Support
Community Support

Hi @Gutts_Zero ,

 

I'm sorry I don't have access to your pbix file.

Double-check the data types and values of the arguments to be passed to the function to ensure that they are correct and within acceptable limits.

According to the documentation, the per argument must be between 1 and nper (inclusive). However, in your measure, you have max(fact[period]) as the per argument, which may be greater than loan period [loan period value]*12, which is the nper argument. This could cause the error that you see.

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. 

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.