Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hola, chicos
Me enfrento a dificultades para calcular la suma de una columna donde los límites de tiempo de la suma se determinan a través de una segmentación de datos:
El valor que debo obtener es la suma de 'Quantité N' desde la fecha más baja hasta la fecha determinada por la segmentación menos 1 año.
La fórmula actual es la siguiente:
Así que esta fórmula me da un resultado que sé que está mal porque no detiene la suma que debe y cuando uso esta fórmula
Solved! Go to Solution.
Hola @ReportingGB11 ,
Podemos crear una medida para satisfacer sus necesidades.
1. En primer lugar, necesitamos eliminar la relación entre la tabla SPHStockPF y la tabla de fechas.
Cree una segmentación de fechas mediante la tabla Fecha.
2. Entonces podemos crear una medida.
Stock Physique N-1 V2 =
var _select = DATE(YEAR(MAX('Date'[Date]))-1,MONTH(MAX('Date'[Date])),DAY(MAX('Date'[Date])))
return
CALCULATE(SUM('SPHStockPF'[Quantité N]),FILTER('SPHStockPF','SPHStockPF'[Posting Date]>=DATE(2019,1,10) && 'SPHStockPF'[Posting Date]<=_select))
Si no cumple con sus requisitos, ¿podría mostrar el resultado esperado exacto basado en la tabla que ha compartido?
Saludos
Equipo de apoyo a la comunidad _ zhenbw
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
BTW, pbix como adjunto.
Hola @ReportingGB11 ,
Podemos crear una medida para satisfacer sus necesidades.
1. En primer lugar, necesitamos eliminar la relación entre la tabla SPHStockPF y la tabla de fechas.
Cree una segmentación de fechas mediante la tabla Fecha.
2. Entonces podemos crear una medida.
Stock Physique N-1 V2 =
var _select = DATE(YEAR(MAX('Date'[Date]))-1,MONTH(MAX('Date'[Date])),DAY(MAX('Date'[Date])))
return
CALCULATE(SUM('SPHStockPF'[Quantité N]),FILTER('SPHStockPF','SPHStockPF'[Posting Date]>=DATE(2019,1,10) && 'SPHStockPF'[Posting Date]<=_select))
Si no cumple con sus requisitos, ¿podría mostrar el resultado esperado exacto basado en la tabla que ha compartido?
Saludos
Equipo de apoyo a la comunidad _ zhenbw
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
BTW, pbix como adjunto.
Muchas gracias por la ayuda
@ReportingGB11 si su objetivo es obtener valor del año pasado, puede utilizar muchas funciones de inteligencia de tiempo como PARALLERPERIOD, SAMEPERIODLASTYEAR o DATESADD
por ejemplo
PY = CALCULATE ( [Your Measure], DATEADD ( DateTable[Date], -1, YEAR ) )
Me gustaría ❤ elogios si mi solución ayudara. 👉 Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!
⚡Visítenos en https://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.⚡
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.
@ReportingGB11 , Probar como
Año detrás de Ventas: CALCULATE(SUM(SPHStockPF[Quantité N]),dateadd('Date'[Date],-1,Year),'Date'[Date]>- DATE(2018,12,31))
Espero que necesite datos > jan 2018
@amitchandak y @parry2k , muchas gracias por sus respuestas.
Sin embargo, no puedo mostrar la solución proporcionada por @amitchandak, la función DATEADD muestra un error: "espera una selección contigua ....". Sin embargo, la tabla Date en la que se realiza la función DATEADD es una tabla de calendario
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.