Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Hiding/Blank : Infinity / NaN Error

Hey guys!

 

I am working with measures and I have got some Inifity / NaN Errors in my matrix which I want to show blank or hide them.

 

I usually use this measure for calculation:

 

 

SOTag Entw. = 
VAR __s = [SO/Tag 2020]/[SO/Tag 2019]
RETURN
IF ( __s  <> BLANK(), __s - 1 ) 

 

 

What do I need to add to those measures to blank those errors? Thanks!

  • ibarrau's avatar
    ibarrau
    6 years ago

    Don't worry, you are just learning 🙂
    I was talking about variables. Like this:

    Entw.20 vs 19_DIOR = 
    VAR _division = 
    DIVIDE( 
        SUM('Jahr_Plan'[DIOR 20]),
        SUM(Jahr_Plan[DIOR 19]),
        BLANK()
    ) 
    RETURN
    IF(
        ISBLANK(_division),
        BLANK(),
        _division -1
    )

    Hope this time works !

8 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Icon for Community Champion rankCommunity Champion
    The DIVIDE function will fix that for you

    SOTag Entw. =
    VAR __s =DIVIDE( [SO/Tag 2020], [SO/Tag 2019] )
    RETURN
    IF ( __s <> BLANK(), __s - 1 )
      • ibarrau's avatar
        ibarrau
        Icon for Super User rankSuper User

        Hi, I'm not sure about NaN because it sounds like that value is in the data before calculation. The problem with the formula is that you need to add a value in case of infinity or error for the division function. Like this:

        DIVIDE(
            [SO/Tag 2020], [SO/Tag 2019]
            , BLANK()
        )

        That way it will return blank if the division contains an error or infinity.

         

        Regards,

  • Anonymous ,

    SOTag Entw. = divide([SO/Tag 2020],[SO/Tag 2019])

     

    or

     

    SOTag Entw. =
    VAR __s = divide([SO/Tag 2020],[SO/Tag 2019])
    RETURN
    IF ( __s <> BLANK(), __s - 1 )