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
o59393
Post Prodigy
Post Prodigy

Cómo calcular el valor máximo y su predecesor

Hola a todos

¿Cómo puedo calcular el valor máximo de una demanda en un mes determinado y su valor predecesor frente a la capacidad del valor máximo de la demanda y la capacidad predecesora?

Por ejemplo:

ssa.JPG

En esta tabla mi demanda máxima es el valor en amarillo para diciembre de 2020.

¿Cómo puede calcular la medida:

La demanda máxima (color amarillo) + el predecesor (color verde) - el valor de capacidad de la fila de demanda máxima (color azul) + la capacidad predecesora (color gris)

Adjunto el excel y pbix.

https://1drv.ms/u/s!ApgeWwGTKtFdhx92MNyIjJaTqapT?e=NQ78Nu

¡Gracias!

4 REPLIES 4
dax
Community Support
Community Support

Hola @o59393 ,

Debe agregar mes en la tabla y usar las siguientes medidas para lograr este objetivo. Podrías consultar mi muestra para más detalles.

Saludos
Zoe Zhi

Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

@dax wow

Muchas gracias, dax muy poderoso.

Hola @dax

Estaba replicando su solución en mi pbix final, pero tengo un problema

En su primera parte de la fórmula

pre cap = VAR month = LOOKUPVALUE ( Capacidad[Month], Capacidad[Capacity], [max cap] )

Y

pre dem = VAR month = LOOKUPVALUE ( Capacidad[Month], Capacidad[Demand], [max dem] )

Los valores Capacidad[Month] y Capacidad[Capacity] y Capacidad[Demand] en mi pbix final son columnas y medidas calculadas.

Creo que eso me está dando un problema, porque me está devolviendo la capacidad total (32M), pero debe ser sólo los 2 meses:

¿Puedes aconsejarme cómo hacerlo bien en mi pbix?

https://1drv.ms/u/s!ApgeWwGTKtFdhyEaO7IZgUhf2Q-l?e=pdlEoghttps://1drv.ms/u/s!ApgeWwGTKtFdhyEaO7IZgUh...

Gracias

amitchandak
Super User
Super User

@o59393, vea si la inteligencia del tiempo puede funcionar

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
Month behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))

Comprobar

https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únase a ella con la columna de fecha de su/s hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

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.