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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Yrstruly2021
Helper V
Helper V

Issue with the ROUND function

MicrosoftTeams-image (13).png

I am geting the error above for these codes. Where am i going wrong?

Dynamic Forecast measure = 
SWITCH(
    SELECTEDVALUE(Dynamic_Selection_Period[Period]),
    "Prediction",
    "Forecast: " & 
    IF(
        ISERROR([Time Metric Calculations FCST]),
        "Error",
        ROUND([Time Metric Calculations FCST], 2)
    ) & 
    " (" & 
    IF(
        ISERROR([Time Metric Calculations CY Forecast] - [Time Metric Calculations FCST]),
        "Error",
        ROUND(([Time Metric Calculations CY Forecast] - [Time Metric Calculations FCST]), 2)
    ) & 
    ", " & 
    IF(
        ISERROR(([Time Metric Calculations CY Forecast] - [Time Metric Calculations FCST])/[Time Metric Calculations FCST]),
        "Error",
        ROUND(([Time Metric Calculations CY Forecast] - [Time Metric Calculations FCST])/[Time Metric Calculations FCST], 2)
    ) & 
    "%)",
    "MTD",
    "Forecast: " & 
    IF(
        ISERROR([Time Metric Calculations FCST]),
        "Error",
        ROUND([Time Metric Calculations FCST], 2)
    ) & 
    " (" & 
    IF(
        ISERROR([Time Metric Calculations CY] - [Time Metric Calculations FCST]),
        "Error",
        ROUND([Time Metric Calculations CY] - [Time Metric Calculations FCST], 2)
    ) & 
    ", " & 
    IF(
        ISERROR(([Time Metric Calculations CY] - [Time Metric Calculations FCST])/[Time Metric Calculations FCST]),
        "Error",
        ROUND(([Time Metric Calculations CY] - [Time Metric Calculations FCST])/[Time Metric Calculations FCST], 2)
    ) & 
    "%)"
)
Dynamic Forecast measure = SWITCH(SELECTEDVALUE(Dynamic_Selection_Period[Period]),"Prediction","Forecast: " & ROUND([Time Metric Calculations FCST],2) & " (" & ROUND(([Time Metric Calculations CY Forecast] - [Time Metric Calculations FCST]),2) & ", " & ROUND(([Time Metric Calculations CY Forecast] - [Time Metric Calculations FCST])/[Time Metric Calculations FCST],2) & "%)","MTD","Forecast: " & ROUND([Time Metric Calculations FCST],2) & " (" & ROUND([Time Metric Calculations CY] - [Time Metric Calculations FCST],2) & ", " & ROUND(([Time Metric Calculations CY] - [Time Metric Calculations FCST])/[Time Metric Calculations FCST],2) & "%)")
2 REPLIES 2
Anonymous
Not applicable

Hi @Yrstruly2021 

 

Judging from your error message, the problem is with your Range function.You use the ROUND function to round the result to two decimal places. This should be fine, but you need to make sure that the rounded value is of the numeric type.

 

If the above suggestions don't help you solve your problem, please provide detailed sample pbix file and the results you expect.So that I can help you better. Please remove any sensitive data in advance.

 

 

Best Regards,

Jayleny

 

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

lbendlin
Super User
Super User

The measures may be BLANK() rather than erroring out. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.