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

Agregar por meses y calcular el promedio

Hola

Tengo una tabla como la siguiente:

REQUESTED_DATEValor
01.01.201810
......
28.01.20188


Quiero mostrar lo siguiente en un diagrama de líneas:

Eje X: fijo 12 meses (enero-diciembre; año hábil)

Primera línea:

VALOR sumado para cada mes

Segunda línea:

Avergage of VALUE last year as a straight line (but mapped/shown to the fixed X-axis)

¿Cómo puedo lograrlo?

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hola @MIuser1

Crear una medida

average last year = CALCULATE(AVERAGE('Table 3'[value]),FILTER(ALLSELECTED('date'),DATEADD('date'[Date],-1,YEAR)))

Capture2.JPGCapture3.JPG

Saludos
Maggie
Equipo de apoyo a la comunidad _ Maggie Li
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

amitchandak
Super User
Super User

@MIuser1, intenta con la inteligencia del tiempo

YTD Sales = CALCULATE([Avg Monthly],DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE([Avg Monthly],DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE([Avg Monthly], DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE([Avg Monthly],DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE([Avg Monthly],DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))

Consulte Power BI — Preguntas YTD — Time Intelligence 1–5
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

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.

Anonymous
Not applicable

Gracias por su rápida respuesta.

¿Podría explicarme también cómo lograr la agregación por mes?
Tengo muchas fechas, pero no sé, cómo agregarlas para un gráfico de líneas.

Este es mi resultado esperado:

MIuser1_0-1595331063657.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.