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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Ben00
Regular Visitor

VARIACION ENTRE 2 TABLAS EN UNA MISMA MATRIZ

Estimados

Estoy tratando de realizar una variación entre dos tablas diferentes:

 

Tabla 1 (Gasto Real) (almacena información de CUENTA: Remuneración, Ropa Corporativa y Arriendos por mes y año)

Tabla 2 (Presupuesto) (almacena información de CUENTA: Remuneración, Ropa Corporativa y Arriendos por mes y año)

 

Para que la mejor opción que logre desarrollar, fue a través de una tercera tabla pibote (3) que unifique la tabla 1 (gasto real) con la tabla 2 (presupuesto),

image.png

 

Mostrando en una MATRIZ 1, tanto el gasto como el presupuesto de una CUENTA,

image.png

 

Y en Matriz (MATRIZ 2) se realiza bajo la MATRIZ 1, una medida para calcular la variación:

 
image.png
VARIACIÓN =
var GASTOTOTAL = CALCULATE(sum(GastoReal[Valor/mon.inf.]),GastoReal[TIPO]="GASTO TOTAL")
var PPTO = CALCULATE(sum(DataPresupuesto[Valor/mon.inf.]),DataPresupuesto[TIPO]="PPTO")
RETURN if(isblank(GASTOTOTAL - PPTO),"0",GASTOTOTAL - PPTO)

 

Si bien, se puede realizar el trabajo de esta forma, lamentablemente cuando se usan los filtros, se desordenan los campos, entre los valores de la variación de los valores). Por lo tanto, me gustaria saber si alguien tiene una forma de realizar esta modificación entre dos tablas distintas dentro de la misma MATRIZ (ya que no ha encontrado una solución similar dentro del foro)

 

Muchas gracias,

 

Atte.

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@Ben00 ,

This is a forum which discusses technical issues about PowerBI desktop in English, I would suggest you using English to discuss this problem.

 

Could you please share the sample data and expected result to us for analysis? Which filter did you use causing fields disordered?

 

Based on my test, it works normally in my environment:
1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dear Lydia,

 

I appreciate your response and I apologize for the language used.

 

I attach an example of .pbix

https://drive.google.com/open?id=1Gbb242mcrqKy2Zh7s0OVSPrYsGHsx1Og

The result should be:

 

ZOOM 3 PPTOGASTO TOTALPPTOVARIACION
ARRIENDO DE EQUIPOS DE OFICINA7350360-6990
REMUNERACION3400 -3400
ROPA CORPORATIVA29001800-1100
TOTAL136502160-11490

 

 

Thank you very much for your help!

@Ben00 ,

I am unable to access your PBIX file as it requires permission.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors