cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Cómo calcular YTD de cada mes

Datos, por ejemplo:

MesEnero YTD Febrero YTD AvgAvg
Lugar2019202020192020201920202019202020192020
x500000450000??300000470000????
y100000560000??600000950000????

Ahora quiero calcular YTD para estos valores en Power Bi.

Y también quiero calcular el promedio de los meses.

Requiere ayuda en esto. Gracias de antemano.

2 REPLIES 2
v-xicai
Community Support
Community Support

Hola @Divyanshu07 ,

Puede crear una tabla de calendario en primer lugar, crear una relación con su tabla de hechos en el campo de fecha y, a continuación, crear medidas como DAX a continuación en la tabla de hechos.

Calculated table:

Calendar=CALENDARAUTO()



Measure:



YTD for CY = TOTALYTD(SUM(Table1[Sales]),'Calendar'[Date])



YTD for PY = CALCULATE(SUM(Table1[Sales]),SAMEPERIODLASTYEAR('Calendar'[Date]))



Ave YTD for CY= AVERAGEX(Table1, [YTD for CY] )



Ave YTD for PY= AVERAGEX(Table1, [YTD for PY] )

Saludos

Amy

Equipo de apoyo a la comunidad _ Amy

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

amitchandak
Super User
Super User

@Divyanshu07 ,

¿Está buscando el formato o YTD.

Para la inteligencia de tiempo de uso YTD y el calendario de fechas

Ejemplo

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

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

Inteligencia del tiempo: https://community.powerbi.com/t5/Community-Blog/Decoding-Direct-Query-in-Power-BI-Part-1-Time-Intell...

Apreciamos tus Felicitaciones.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors