Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

How can I add a measure while using If function?

Hi Everyone,

 

It is hard for me to add a measure like below:

Any help is appreciable. Thank you in advance!

 

Regards,

Kelly

  • Hi Anonymous,

     

    Add the following measure:

     

    Measure =
    IF (
        HASONEFILTER ( Table1[Group] ),
        IF (
            MAX ( Table1[Group] ) = "D",
            5,
            DIVIDE ( SUM ( Table1[Column1] ), SUM ( Table1[Column2] ) )
        ),
        DIVIDE ( SUM ( Table1[Column1] ), SUM ( Table1[Column2] ) )
    )

    Regards,

    MFelix

2 Replies

  • Hi Anonymous,

     

    Add the following measure:

     

    Measure =
    IF (
        HASONEFILTER ( Table1[Group] ),
        IF (
            MAX ( Table1[Group] ) = "D",
            5,
            DIVIDE ( SUM ( Table1[Column1] ), SUM ( Table1[Column2] ) )
        ),
        DIVIDE ( SUM ( Table1[Column1] ), SUM ( Table1[Column2] ) )
    )

    Regards,

    MFelix

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

    Hi Anonymous,

     

    Have you tried the solution provided by MFelix above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

     

    If you still have any question on this issue, feel free to post here. :smileyhappy:

     

    Regards