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
Syndicate_Admin
Administrator
Administrator

Datos actualizados y del año pasado

hola

Me gustaría saber cómo puedo obtener el año actual y el año pasado usando una tabla DimTime.

Tengo filtros como año y período.

Mi tabla DimTime no está relacionada con la misma fecha cada año.

Ejemplo : Mi año inicial de 2020 es 05/01/2020 y 2021 es 03/01/2021.

Necesito obtener el recuento de ventas y el monto de ventas del año actual y el año pasado.

Necesito YTD y PTD

Estoy usando DirectQuery para hacerlo.

saludos

franco

1 ACCEPTED SOLUTION

@Gannicus, funciona muy bien siempre y cuando tengas mesa de citas,

referirse a mi blog

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

Y este video: https://www.youtube.com/watch?v=cf-YNWX8Qow

He probado ambas tablas de fechas en DB y también una en power bi.

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

@Gannicus , Puedes probar medidas como

Ventas YTD = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"4/30"))
Últimas ventas en YTD = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"4/30"))

Power BI — Año tras año con o sin inteligencia de tiempo
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Leí que DATESYTD no se admite en DirectQuery.

@Gannicus, funciona muy bien siempre y cuando tengas mesa de citas,

referirse a mi blog

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

Y este video: https://www.youtube.com/watch?v=cf-YNWX8Qow

He probado ambas tablas de fechas en DB y también una en power bi.

Muchas gracias que funciona.

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.