Forum Discussion

gmasta1129's avatar
gmasta1129
Icon for Resolver I rankResolver I
2 years ago
Solved

Formula "IF(ISBLANK"

Hello,

 

I set up the following measure in Power BI but I want to add this logic to the formula:

 

"If its blank then 25"

I am not sure how to add the above into the formula below.  Can someone please advise? 

 

DIVIDE(
    [Maximum Exposure Amount v2],
    SUM('enav_raw_input_manual_run'[enav_post_hc8])
)
  • You can try either use the third argument in divide (if the blank values are caused by a missing denominator), or use the coalesce function.

    DIVIDE(
        [Maximum Exposure Amount v2],
        SUM('enav_raw_input_manual_run'[enav_post_hc8]), 
        25
    )
    
    OR
    
    COALESCE(DIVIDE(
        [Maximum Exposure Amount v2],
        SUM('enav_raw_input_manual_run'[enav_post_hc8])), 
        25
    ) 
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hello, 

     

    You can try this simple format to achieve it.

    "If its blank then 25" -> If(ISBLANK())
    If(ISBLANK(DIVIDE(
    [Maximum Exposure Amount v2],
    SUM('enav_raw_input_manual_run'[enav_post_hc8])
    )),25,DIVIDE(
    [Maximum Exposure Amount v2],
    SUM('enav_raw_input_manual_run'[enav_post_hc8]))


    or you can try to use "var" as the variable parameter.

    var1 = DIVIDE([Maximum Exposure Amount v2],SUM('enav_raw_input_manual_run'[enav_post_hc8])
    return IF(ISBLANK(var1),25,var1)

2 Replies

  • You can try either use the third argument in divide (if the blank values are caused by a missing denominator), or use the coalesce function.

    DIVIDE(
        [Maximum Exposure Amount v2],
        SUM('enav_raw_input_manual_run'[enav_post_hc8]), 
        25
    )
    
    OR
    
    COALESCE(DIVIDE(
        [Maximum Exposure Amount v2],
        SUM('enav_raw_input_manual_run'[enav_post_hc8])), 
        25
    ) 
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello, 

     

    You can try this simple format to achieve it.

    "If its blank then 25" -> If(ISBLANK())
    If(ISBLANK(DIVIDE(
    [Maximum Exposure Amount v2],
    SUM('enav_raw_input_manual_run'[enav_post_hc8])
    )),25,DIVIDE(
    [Maximum Exposure Amount v2],
    SUM('enav_raw_input_manual_run'[enav_post_hc8]))


    or you can try to use "var" as the variable parameter.

    var1 = DIVIDE([Maximum Exposure Amount v2],SUM('enav_raw_input_manual_run'[enav_post_hc8])
    return IF(ISBLANK(var1),25,var1)