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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Edimar90
Frequent Visitor

dividir fila 1 entre fila 2

Requiero obtener el % de venta el cual se calcula 

 

Gastos / Ventas 

 

Pero los datos los tengo en categoria Planta y subcategoria Rubro como en el ejemplo de la imagen:

Planta = PLANTA 1 Y PASTAS

Rubro = [Kilos Ventidos],Ventas,Gastos

Values = Columna Anterior

Edimar90_0-1716313431806.png

Edimar90_1-1716313657473.png

 

 

El problema:

Al momento de dividir gastos /  venta = ERROR 

Lo correcto seria lo siguiente: 
13,204,780 / 74,215,884 = 0.177922936281403

 

Gracias por la ayuda.

1 ACCEPTED SOLUTION
v-tianyich-msft
Community Support
Community Support

Hi @Edimar90 ,

 

Add the ALL or ALLSELECETED function in front of the tb_Admon_Gastos_Planta table, I'm not sure if it meets your expected results, please show the sample data in a usable form as well as the expected results.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

View solution in original post

4 REPLIES 4
v-tianyich-msft
Community Support
Community Support

Hi @Edimar90 ,

 

Add the ALL or ALLSELECETED function in front of the tb_Admon_Gastos_Planta table, I'm not sure if it meets your expected results, please show the sample data in a usable form as well as the expected results.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

ya tengo los dos valores separados pero sigue mandando error en la divicion:

Edimar90_0-1716391715931.png

 

GastosAntALL = CALCULATE([GastosAnterior],ALL(tb_Admon_Gastos_Planta[PLANTA]))
VentasAntALL = CALCULATE([VentasAnterior],ALLSELECTED(tb_Admon_Gastos_Planta[PLANTA]))

%/VNAntPlantas = CALCULATE(tb_Admon_Gastos_Planta[GastosAntALL]/[VentasAntALL],ALLSELECTED(tb_Admon_Gastos_Planta[PLANTA]))
 
Gracias!
 
AnalyticPulse
Impactful Individual
Impactful Individual

I need to split the rows

Row Expenses / Row Sales

But I have the data in the Plant category and the Category subcategory, as in the example in the image:


Edimar90_0-1716315440599.png

 

 

Plant = PLANT 1 AND PASTA

Item = [Kilos Sold],Sales,Expenses

Values = Previous Column




The problem:

At the time of splitting expenses/sales = ERROR

My table:

Edimar90_1-1716315762255.png

act = Value
Rubro = subcategory
Planta = category


My operation is: 

Gastos = CALCULATE( SUM(tb_Admon_Gastos_Planta[act]), FILTER(tb_Admon_Gastos_Planta,tb_Admon_Gastos_Planta[Rubro] = "Gastos"))

Ventas = CALCULATE( SUM(tb_Admon_Gastos_Planta[act]), FILTER(tb_Admon_Gastos_Planta,tb_Admon_Gastos_Planta[Rubro] = "Ventas"))

DIVIDE(SUMX(tb_Admon_Gastos_Planta,tb_Admon_Gastos_Planta[Gastos]),SUMX(tb_Admon_Gastos_Planta,[Ventas]),0)

The correct thing to do would be the following:
13,204,780 / 74,215,884 = 0.177922936281403

Thanks for the help

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.