Forum Discussion

LewisH's avatar
LewisH
Helper II
8 years ago
Solved

IF Statement

In the calculation I want it to display 0 if the result is 0 rather than blank 

 

Supplier Performance Orig. Expected Percentage OnTime = CALCULATE('Purchase Lines'[Supplier Performance Orig. Expected Total OnTime] / ('Purchase Lines'[Supplier Performance Orig. Expected Total OnTime] + 'Purchase Lines'[Supplier Performance Orig. Expected Total Late] ) * 100)

 

Thanks

  • Hi LewisH,

     

    Please try this:

    Supplier Performance Orig. Expected Percentage OnTime =
    CALCULATE (
        'Purchase Lines'[Supplier Performance Orig. Expected Total OnTime]
            / ( 'Purchase Lines'[Supplier Performance Orig. Expected Total OnTime]
            + 'Purchase Lines'[Supplier Performance Orig. Expected Total Late] )
            * 100
    )
        + 0

     

    Best regards,

    Yuliana Gu

1 Reply

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi LewisH,

     

    Please try this:

    Supplier Performance Orig. Expected Percentage OnTime =
    CALCULATE (
        'Purchase Lines'[Supplier Performance Orig. Expected Total OnTime]
            / ( 'Purchase Lines'[Supplier Performance Orig. Expected Total OnTime]
            + 'Purchase Lines'[Supplier Performance Orig. Expected Total Late] )
            * 100
    )
        + 0

     

    Best regards,

    Yuliana Gu