Forum Discussion

HamidBee's avatar
HamidBee
Power Participant
4 years ago
Solved

Missing Percentage values

I created a chart which shows the percentage difference over months. If the base value is zero then it doesn't show any value. I'm really nor sure what I'm misisng here. Please see below:

 

I used one of the quick measures:

 

PD.Mixed =
VAR __BASELINE_VALUE = SUM('2020'[Mixed])
VAR __VALUE_TO_COMPARE = SUM('2021'[Mixed])
RETURN
    IF(
        NOT ISBLANK(__VALUE_TO_COMPARE),
        DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)
    )
 
Any help is appreciated.
 
Thank you.
  • Hi, HamidBee 

     

    I made a mistake in the code, I have modified '__BASELINE_VALUE' to '__VALUE_TO_COMPARE'. You can check it.

    I respect your decision, if you change your mind and have other problems, you can feel free to ask me. And 

    If my post helps, please consider Accept it as the solution to help the other members find it more quickly. Thank you.
     
    Best Regards,
    Community Support Team _ Janey

10 Replies

    • HamidBee's avatar
      HamidBee
      Power Participant

      Are you referring to this as it seems it was already on percent:

       

      It seems it hasn't resolved the issue:

       

      Also, is this what you mean by bar and line visual:

       

       

      • amitchandak's avatar
        amitchandak
        Super User

        HamidBee , I meant line and clustered column visual.

         

        Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • v-janeyg-msft's avatar
    v-janeyg-msft
    Community Support

    Hi, HamidBee 

     

    As long as there is a 0 in the divisor or dividend, the result is 0. So what's your confusion?

    I downloaded your sample and found no problems. Is this(create a column:[A]-[B]) what you want?

    If not, What's your desired result?

    Did I answer your question ? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.
     
    Best Regards,
    Community Support Team _ Janey

     

    • HamidBee's avatar
      HamidBee
      Power Participant

      Thank you. I would like it to display the percentage increase even if the base value is zero. For example in April it went from 0  to 21 but it doesn't calculate a percentage increase. 

      • v-janeyg-msft's avatar
        v-janeyg-msft
        Community Support

        HamidBee  Can you share your desired result or your calcultion logic? I don’t understand what percentage increase you said should be presented in the visual.