Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
Anonymous
Not applicable

TOTALYTD - resultados incorrectos

Hola comunidad,

Me interesaba "cómo calcular las ventas del año hasta la fecha más eficientes". Hasta hoy, siempre decía algo como esto:

MaxDate 29.09.2020

YearStart á 01.01.2020

Calculate(Sum(Sales), Filter( YearStart<-Date <- MaxDate))

Pero debe haber una manera más elegante de hacer esto. Probé el DAX-Functions TOTALYTD & una combinación de CALCULATE + DATESYTD como este:

TOTALYTD

TOTALYTD( CALCULATE (Sum ( 'SALES'[Amount] ) ),'SALES'[Fecha] )

RESULTADO: Sumar todo el año (500 en lugar de 350 hasta hoy)

CALCULATE + DATESYTD

CALCULATE( Sum ( 'SALES'[Amount] ), DATESYTD ( 'SALES'[Date] ) )

RESULTADO: Sumar años enteros (3000 en lugar de 350 hasta hoy)

¿Qué me estoy perdiendo? ¿Por qué Power BI incluye todos los valores hasta fin de año y no se detiene en la fecha de hoy (29.09.2020)? ¡Gracias de antemano!

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@inf1948

Para utilizar las funciones de inteligencia de tiempo, necesita una tabla de fechas como una tabla dimensionada con fechas continuas que cubran el intervalo de fechas del modelo.

A continuación, utilice el campo Tabla de fechas [Fecha] en las expresiones en lugar de las ventas [Fecha]





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

@inf1948

Para utilizar las funciones de inteligencia de tiempo, necesita una tabla de fechas como una tabla dimensionada con fechas continuas que cubran el intervalo de fechas del modelo.

A continuación, utilice el campo Tabla de fechas [Fecha] en las expresiones en lugar de las ventas [Fecha]





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Hola PaulDBrown,

Gracias. Ahora, cizará el total de carreras. Pero aún hasta el final del año y no ytd.

¿Es obligatorio una bandera o una definición explícita de la fecha de hoy?

1.PNG 2.PNG

Yo esperaría que el cálculo termine aquí...

@inf1948

Sí, si desea que la medida se detenga en la fecha de hoy, debe especificarla (de lo contrario devolverá los valores incluidos en el contexto del filtro).
Una forma de hacerlo es:

hoy límite ?
IF(MAX(Date[Date]<- TODAY(), [Sales Ytd TotalYtd])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.