Buenas tardes,
Tengo la siguiente tabla. En ella necesito que me calcule el % en cada una de las filas sobre el total de las prestaciones de servicios.
He realizado dos medidas:
La primera es la siguiente, para aislar por decirlo de alguna manera, las ventas:
Donde el 705 es la cuenta contable donde se engloba todas las ventas.
Y la segunda es la siguiente para llevarla al modelo y calcular el % en cada una de las filas:
Es curioso que me salga bien al calcular el resultado de explotación, en la prestación de servicios (que es 100% al ser el mismo importe), y en resultado del ejercicio.
Pero en el resto de filas me pone infinito. Y no hay ceros, ya que hay importes en el saldo de cuentas de cada una de las filas.
Y si incluyo la orden DIVIDE me aparece en vez de infinito 0.
Alguna idea???
Muchas gracias!
Hi @xetler ,
In DAX, you can use the IFERROR function to replace the infinite value with another value. The IFERROR function takes two arguments: the first argument is the expression that you want to evaluate, and the second argument is the value that you want to return if the expression evaluates to an error.
Here's an example of how you can use the IFERROR function to replace the infinite value with 0:
=IFERROR(DIVIDE(numerator, denominator), 0)
In this example, the DIVIDE function is used to divide the numerator by the denominator. If the result of the division is infinite, the IFERROR function will return 0 instead.
You can replace the 0 with any other value that you want to return if the expression evaluates to an error.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Stephen!
Thanks, but it is not the solution that I need.
The result that I need would be based on the following division:
190690,23 / 2415628,50 7,89% (ok)
2415628,50 / 2415628,50 100,00% (ok)
-596413,05 / 2415628,50 24,69% (and not "-infinito")
.......
Thanks,
User | Count |
---|---|
105 | |
30 | |
22 | |
18 | |
15 |
User | Count |
---|---|
95 | |
22 | |
17 | |
17 | |
16 |