Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure to return value based on another measure

Hi all, new to the group and PBI, this will be basic for a lot of you, I have a measure - "Hourly Average = DIVIDE([Inducted],[Hour Runtime],0)". I want this to return a the value only if another measure [Sorted] is greater than 50. Any help will be appreciated - thanks in advance, Daniel

  • Hi Anonymous 

     

    Try this

     

    Hourly Average = IF(Sorted > 50, DIVIDE([Inducted],[Hour Runtime],0), "")

     

    regards

     

    Phil

3 Replies

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

     

    You can create a measure with below code:-

    Hourly Average =
    VAR result =
        DIVIDE ( [Inducted], [Hour Runtime], 0 )
    RETURN
        IF ( [sorted] > 50, result, BLANK () )

     

    Thanks,

    Samarth

  • Hi Anonymous 

     

    Try this

     

    Hourly Average = IF(Sorted > 50, DIVIDE([Inducted],[Hour Runtime],0), "")

     

    regards

     

    Phil