Forum Discussion

LamSar's avatar
LamSar
Helper III
4 years ago

Divide function with incorrect result

Good afternoon,

 

I have a problem with a formula to calculate a percentage. 

 

See picture below:

The red bar shows 11,56%.

The pct column in the tooltip is not 11% in total. 

 

This is the measure I used: 

pct reden te kort =
VAR totManco = CALCULATE(sum(Leverorder[aantal manco]), Manco[Reden van tekort (groep)] = "Overige")
RETURN
DIVIDE([Aantal manco], totManco,0)
 
What am I doing wrong?
 
Thank you.

5 Replies

  • Hi LamSar ,

     

    How is the other measure calculated: [Aantal manco] ?

     

    Thanks,

    Pragati

    • LamSar's avatar
      LamSar
      Helper III
      Aantal manco = SUM(Manco[Totaal Manco])
    • Pragati11's avatar
      Pragati11
      Super User

      HI LamSar ,

       

      Is your custom tooltip using a different percentage calculation? I see in the screenshot, that it uses pct for showing percentages.

      My understanding is your column chart is using pct reden te kort. So it is different to the tooltip.

       

      Thanks,

      Pragati

      • LamSar's avatar
        LamSar
        Helper III

        No, the column chart also uses the measure [aantal manco]. But per category. 
        And for the tooltip, I need the percentage per subcategory in the category.