Forum Discussion

RicardoLeivaG's avatar
6 years ago
Solved

Ayuda con indicador variable

Hola comidad tengo el siguiente tema, tengo una medida rapida creada que calcula un procentaje

 

% Contribucion = DIVIDE(SUM('det_factura20062020'[contribucion]); 140000000)
 
esto solo funciona si selecciono un mes, pero al seleccionar 2 o mas el monto de contribucion sube mientras la meta sigue fija en 140000000, como puedo comolar ese valor fijo en variable???? que aumente si sumo mas meses y que vuelva a  140000000 si lecciono solo 1???
 
 
 
  • You could set that store that in a variable, and multiple that by the count of selected values.  However, an easier way might be a measure like this one:

     

    Avg Monthly % Contribution = Averagex(Values(Table[Month]), [% Contribucion])

     

    This will calculate the % Contribution for each month and give you the average value.

     

    If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

3 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    You could set that store that in a variable, and multiple that by the count of selected values.  However, an easier way might be a measure like this one:

     

    Avg Monthly % Contribution = Averagex(Values(Table[Month]), [% Contribucion])

     

    This will calculate the % Contribution for each month and give you the average value.

     

    If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

  • dax's avatar
    dax
    Community Support

    Hi RicardoLeivaG , 

    I am not clear about your requirement? Did you mean that you will  always get 1 as result? If so, you need to check meaurse data tyoe and format to see whether it is demical and whether it shou multiple decimal places. And I don't understand the requirement of 140000000, could you please explain this in details(such as use your sample and expected output)?

    Please do mask sensitive data before uploading.

    Thanks for your understanding and support.
    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • the value of the formula that is expressed as 140,000,000 is the goal per month, what I need is that this value increases if 2 or more months are selected, and that it is only 1 if you select any month.

      example

      if the user selects january

      % Contribution = DIVIDE (SUM ('det_factura20062020' [contribution]); (140000000 * 1))

      If you select January and February
      % Contribution = DIVIDE (SUM ('det_factura20062020' [contribution]); (140000000 * 2))
      if you select June
      % Contribution = DIVIDE (SUM ('det_factura20062020' [contribution]); (140000000 * 1))