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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

IFERROR Error

I am getting an error "Argument '2' in IFERROR function is required.

 

 

% of Stores with void =
IF(
    HASONEVALUE(DTRData[Item]),
        IFERROR(DIVIDE(
            SUM('DTRData'[Void Count]),
                [Total Store Count],0),
        IFERROR(DIVIDE(
            SUM('DTRData'[Void Count]),
                AVERAGEX(DTRData,[All Items All Stores Selling]),0),
   
)))
 
Any thoughts for correcting?
5 REPLIES 5
grantsamborn
Solution Sage
Solution Sage

Hi @Anonymous 

The second argument isn't optional.

IFERROR - DAX Guide

 

Anonymous
Not applicable

@grantsamborn 

 

I know that but I am not sure what 2nd argument to list as I thought I had built the formula correctly.

Hi @Anonymous 

Because DIVIDE captures *almost* all possible errors, I'm wondering why you even need IFERROR (or ISERROR).

 

IF you need IFERROR for some reason, the following hopefully shows what you need.

 

% of Stores with void =
IF(
    HASONEVALUE( DTRData[Item] ),
    IFERROR(
        DIVIDE(
            SUM( 'DTRData'[Void Count] ),
            [Total Store Count],
            0
        ),
        ???     // Replace this with the expression you want calculated when the above expression would raise an error.
    ),
    IFERROR(
        DIVIDE(
            SUM( 'DTRData'[Void Count] ),
            AVERAGEX(
                DTRData,
                [All Items All Stores Selling]
            ),
            0
        ),
        ???     // Replace this with the expression you want calculated when the above expression would raise an error.
    )
)

 

 

If you want an example of ISERROR, let me know.

Grant

Are you sure you don't mean ISERROR?

ISERROR - DAX Guide

If the first argument would raise an error, it is replaced by the second argument.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.