Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
xetler
New Member

Resultado infinito

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.

 

xetler_2-1685114640613.png

 

He realizado dos medidas: 

La primera es la siguiente, para aislar por decirlo de alguna manera, las ventas:

 

xetler_0-1685114514095.png

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:

 

xetler_1-1685114589054.png

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!

 

 

 

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

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,

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors