Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Divide + isblank DAX

Hello, 
I have a coloumn [Montant_Global], i wanna divid it by 100 
my mesure is :  Nombre global = Divide([Montant_Global], 100) but i have a blank values so the mesure dosn't work
Can you help me please ? 
Thank you 

  • Hi Anonymous 

     

    How do you want to deal with the blank values? When the Numerator is blank, the returned result will also be blank. If you want to return 0 for blank values, you can add +0 at the end. 

     

    If you want to use a measure, you can also add +0 at the end.

    Measure = DIVIDE(SUM('Table'[Montant_Global]),100)+0

    If you want other outputs, let me know so that I can help further.

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

4 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi Anonymous 

     

    How do you want to deal with the blank values? When the Numerator is blank, the returned result will also be blank. If you want to return 0 for blank values, you can add +0 at the end. 

     

    If you want to use a measure, you can also add +0 at the end.

    Measure = DIVIDE(SUM('Table'[Montant_Global]),100)+0

    If you want other outputs, let me know so that I can help further.

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.

  • Hi, Anonymous 

    I assume you want to create a measure, not a new column.

    Please try something like below.

     

    Nombre global =
    SUMX ( 'your table name', DIVIDE ( [Montant_global], 100 ) )

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,
      thank you for your suggestion, can i know why you used Sumx ? 
      The aim of my mesure is to divide [Montant_Global] by 100 but in my coloumn i hava an empty values. 
      Thank you 

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Icon for Super User rankSuper User

        Hi, Anonymous 

        Thank you for your feedback.

        Is the measure working?

        The reason why I used SUMX is that the column [Montant_Global] itself does not show anything in the measure. It shows something when creating a new column (Calculated Column), but when the column needs to act a part inside the measure, one of many ways to make this happen is using the X function.

        So, it depends on your needs. You can use SUMX, AVERAGEX, COUNTX, or whatever X function you want.

         

        For instance,

        After you divide, and if you want to sum all the results, then I think SUMX is the relevant one.

        After you divide, and if you want to know the average of each row, then I think AVERAGEX is the relevant one.

         

        Hi, My name is Jihwan Kim.

         

        If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

         

        Linkedin: linkedin.com/in/jihwankim1975/

        Twitter: twitter.com/Jihwan_JHKIM