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
Anonymous
Not applicable

Restar Valores de dos tablas

Buenas tardes. 

 

Deseo su ayuda quiero sacar un delta o diferencias de valores de dos tablas diferentes, ya que los campos del nombre son iguales pero los valores a veces cambian y queiro saber cuál es la diferencia o una resta de la tabla A con la Tabla B y viceversa.

 

 

Por ejempl como la imagen en el mes de mayo tuvo 8 valores en la tabla A y en la tabla B tuve 25, segun la diferencia seria: 17

ayamaya_0-1626468674732.png

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , You need to have common dimensions, Date, and services. Then you can

You display measure together and have diff too

 

Sum(Table1[Value]) - Sum(Table2[Value])

 

refer if needed

 

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

View solution in original post

v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

Not sure about your table structure, I assume there are two tables with the same fields. Create a one-to-one relationship between the service IDs and then create the following column:

delta = CALCULATE(SUM('Table1'[Value])-CALCULATE(SUM(Table2[Value])))

Sample data:

vangzhengmsft_0-1626772003972.png

Result:

vangzhengmsft_2-1626772020082.png

Please refer to the attachment below for details

If it doesn't work for you, then please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.

 

Hope this helps.

 

Best Regards,
Community Support Team _ Zeon Zheng
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

6 REPLIES 6
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

Not sure about your table structure, I assume there are two tables with the same fields. Create a one-to-one relationship between the service IDs and then create the following column:

delta = CALCULATE(SUM('Table1'[Value])-CALCULATE(SUM(Table2[Value])))

Sample data:

vangzhengmsft_0-1626772003972.png

Result:

vangzhengmsft_2-1626772020082.png

Please refer to the attachment below for details

If it doesn't work for you, then please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.

 

Hope this helps.

 

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

 

Buenas tardes

 

Como  puedo obtener resta entradas menos salidas y que se aplique a cada posición

17082014198344213066111580560374.jpg

Anonymous
Not applicable

Muchas gracias, ahora lo que tengo que hacer es poder mostar, solo los datos que tengan un delta osea que de los 100 registros que tengo, 25 tienen delta solo debo mostrar aquellos nombres y valores que tienen una diferencia es posible hacer eso?

amitchandak
Super User
Super User

@Anonymous , You need to have common dimensions, Date, and services. Then you can

You display measure together and have diff too

 

Sum(Table1[Value]) - Sum(Table2[Value])

 

refer if needed

 

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

Anonymous
Not applicable

Muchas gracias, ahora lo que tengo que hacer es poder mostar, solo los datos que tengan un delta osea que de los 100 registros que tengo, 25 tienen delta solo debo mostrar aquellos nombres y valores que tienen una diferencia es posible hacer eso?

Anonymous
Not applicable

Hello, thank you very much for your answer, but what I need is first to compare the lines and find the difference per line, from what I see you tell me the total.

 

ayamaya_1-1626697948813.png

 

 

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.