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

Obtención de variaciones mediante el chasquido de la estructura de datos

Hola a todos,

Tengo el siguiente conjunto de datos:

mafaldavs123_0-1603727271662.png

Me gustaría tener una mesa como esta :

mafaldavs123_1-1603727306557.png

Para la variación entre 2018 y 2019 y también variación entre Pronóstico y Ventas en cada año.

Supongo que tengo que hacer algunas transformaciones en el conjunto de datos, pero no llegar allí!

¿Puede alguien ayudar

1 ACCEPTED SOLUTION

yo sólo crearía un tabe fecha y luego usar el año de la jerarquía

ver adjunto





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@mafaldavs123 , Mejor tener medidas como estas usando la tabla de fechas y la inteligencia de tiempo

Ventas de TD: 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"))
Este año Ventas: CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Ventas del año pasado: 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"))
Año detrás de Ventas: CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Sólo año vs año, no un nivel por debajo


Este año: CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]-max('Date'[Year])))
Last Year ? CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]-max('Date'[Year])-1))
rolling? CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]>'max('Date'[Year])-2 && 'Date'[Year]<-max('Date'[Year])) )

diff -Este año]-[Año pasado]
diff % á divide([This Year]-[Last Year ],[Last 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, únete a ella con la columna de fecha de tus hechos. Consulte :radacad sqlbi My Video Series Aprecia tus Felicitaciones.

Proporcione sus comentarios y consejos para nuevos videos
Tutorial Series Dax Vs SQL Direct Query PBI Consejos
Apreciamos tus Felicitaciones.

Anonymous
Not applicable

Así que con mis columnas que serían :

Este año: CALCULATE(sum('Dataset'[Daily Sales corrected]),filter(ALL('Dataset'[Date]),'Dataset'[Date][Year]-max('Dataset'[Date][Year])))
?
¿Dónde está mi error?
¿Podría proporcionar el ejemplo con los nombres de mis columnas? Gracias
vanessafvg
Super User
Super User

qué parte estás luchando con exactamente la columna 2018 / 2019 o simplemente la variación. Proporcione datos en formato de texto.




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

Hola @vanessafvg ,

En realidad con las columnas 2018 / 2019.

FechaNombre del productoVentas diariasPronóstico diarioVentas diarias corregidas
01/01/2018Producto A100.99193.000100990,8
02/01/2018Producto A113.184112.000113184
03/01/2018Producto A118.390121.000118389,6
04/01/2018Producto A152.053153.000152053,2
05/01/2018Producto A164.354156.000164354,4
06/01/2018Producto A113.929115.000113929,2
07/01/2018Producto A39.13937.00039139,2

yo sólo crearía un tabe fecha y luego usar el año de la jerarquía

ver adjunto





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

@vanessafvg gracias por ayudar!

Su solución proporciona la variación entre las ventas diarias y las ventas de previsión, pero no da la variación entre las ventas diarias en 2019 frente a las ventas diarias en 2018 o lo hace?

Gracias

no, no lo hace

podrías hacer eso así

Variación de AOE ( YOY variance)

var sales á CALCULATE(sum('Table'[Daily Sales]))
var previousyearsales á CALCULATE(sum('Table'[Daily Sales]), SAMEPERIODLASTYEAR('Table'[Date]))

retorno (DIVIDE(ventas,previousyearsales))




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




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.