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
CJ_96601
Helper V
Helper V

Sum If

Por favor, aconseje sobre cómo sumar todos los datos en dos columnas si el año es menor o igual que la selección del año. La tabla y el calendario tienen relación por fecha.

A continuación se muestran los mismos datos:

añoBnSalario básicoAsignaciones
2020Empleado 110050
2020Empleado 210050
2020Empleado 310050
2020Empleado 410050
2020Empleado 510050
2020Empleado 610050
2020Empleado 710050
2020Empleado 810050
2019Empleado 910050
2019Empleado 1010050
2019Empleado 1110050
2019Empleado 1210050
2019Empleado 1310050
2019Empleado 1410050
2019Empleado 1510050
Total 1500750
si selecciono Año2020la respuesta es 2250
si selecciono Año2019la respuesta es 1050
5 REPLIES 5
parry2k
Super User
Super User

@CJ_96601 probar esta medida

Sum by Year = 
CALCULATE (  
    SUM ( SomeData[Basic Salary] ) + 
    SUM ( SomeData[Allowances] ), 
    FILTER ( 
        ALL ( 'Calendar'[Date] ), 
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) 
    ) 
)

Me gustaría💖 elogios🙂 si mi solución me ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para darle a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Gracias

Probado su solución, calcula pero omite al azar algunas filas en mi archivo de Excel (con 6000 filas para calcular).

Todas las fechas están bien

¿Alguna idea de por qué?

@CJ_96601 muy difícil de decir sin mirar eso por qué sería. Usted tiene que validar al final o enviar el archivo pbix



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Compartir:

Este funciona:

TotalComp ?

CALCULATE(SUMX(CnB_D,CnB_D[Comp]+CnB_D[Comp1]+CnB_D[Comp2]+CnB_D[Comp3]+CnB_D[Comp4]),


FILTRO (
ALL ( 'CnB_D'[Fecha de Contratación].[ Año]),
'CnB_D'[Fecha de Contratación]. [Año] <o MAX ( 'zCalendar'[Año])
)
)

Gracias. Lo haré

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.