9 Replies Latest reply: Sep 16, 2016 10:57 AM by Saulo Abip Gonçalves RSS

    Client with third largest sales



      I'm trying to create a KPI for each one of the top3 clients by margin. I've so far managed to create a bar chart with the clients with the top 3 margins. But the (slightly) same code won't work for a KPI.

      Here's the (working) code for the measure in the bar chart:

      if(rank((sum(Valor) - sum([Custo]*Horas))/sum(Valor))<=3,(sum(Valor) - sum([Custo]*Horas))/sum(Valor))

      And here's the one I've been trying to make work on a KPI:

      if(rank((sum(Valor) - sum([Custo]*Horas))/sum(Valor))=3,(sum(Valor) - sum([Custo]*Horas))/sum(Valor))

      The problem is the KPI is always "-" no matter what value or expression I put in the code above. I assume there's a misunderstanding in how the aggr function works on my part, but couldn't tell where the error is coming from. Can someone help me?



      Thanks in advance.