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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Good_Stuff
Regular Visitor

An argument of function has wrong data type or the result is too large or too small

I am working on a CAGR Calculation in Power BI, the Syntax is 

CAGR = RRI([Num of CAGR Year],[FirstYearShipValue],[LastYearShipValue])

 

The num of CAGR Year, FirstYearValue and LastYearValue DAX are as below: 

The issue is the calculation could only be visulized individually on a card, once I brought any dimentional attributes to a table with the CAGR calculation, I immediately got en error. 

Could please anyone advice what could be the cause?  How could I fix it? 

 

Thank you!

 

Good_Stuff_0-1720191695941.png

 

 

FirstYearShipValue =
VAR FirstYear = FIRSTNONBLANK ('Calendar (Reporting Date & Backlog GID)'[FY],CALCULATE ([Ship Value]))
VAR FilterYear = FILTER('Calendar (Reporting Date & Backlog GID)', 'Calendar (Reporting Date & Backlog GID)'[FY] =  FirstYear)
 
RETURN
SUMX(FilterYear, [Ship Value])
 
LastYearShipValue =
VAR LastYear = LASTNONBLANK('Calendar (Reporting Date & Backlog GID)'[FY],CALCULATE ([Ship Value]))
VAR FilterYear = FILTER('Calendar (Reporting Date & Backlog GID)', 'Calendar (Reporting Date & Backlog GID)'[FY] =  LastYear)
 
RETURN
SUMX(FilterYear, [Ship Value])
 
Num of CAGR Year =
VAR FirstYear = FIRSTNONBLANK (
     'Calendar (Reporting Date & Backlog GID)'[FY],
    CALCULATE ([Ship Value]))
VAR LastYear = LASTNONBLANK (
    'Calendar (Reporting Date & Backlog GID)'[FY],
    CALCULATE ([Ship Value]))
RETURN LastYear - FirstYear
 

 

 

4 REPLIES 4
Anonymous
Not applicable

Hi @Good_Stuff 

 

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

Best Regards

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

Good_Stuff
Regular Visitor

Thank you for your reply. By using the blow year slicer and a dimentional attribute, I can see I don't have number of years <= 0. But once I bring the CAGR to the table chart, the visual would break and the same error comes up....

 

Good_Stuff_0-1720428209146.png

 

Are you familiar with DAXDebugOutput?  It provides you an option to use EVALUATEANDLOG to troubleshoot your issue.

 

Or you can provide sample data here that illustrates the issue.

lbendlin
Super User
Super User

Quote:

  • An error is returned if:

    • nper ≤ 0.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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