Forum Discussion
Homologar fechas
Hi Juances_17 ,
In the example data you provided, the sales of the same Day Number in 2023 and 2024 are the same. What is the significance of this comparison?
Let me modify your example data a little bit.
In order to use 2023 and 2024 as different legends, unpivot is required.
For convenience, I will make changes to the data in the same table structure as after unpivot.
Create a calculated column that extracts the year of a date:
Year = YEAR('Table'[Date])
Create a calculated column to accumulate sales row by daynumber and year.
Sum Sales = CALCULATE(
SUM('Table'[Sales]),
FILTER(
ALL('Table'),
'Table'[Year] = EARLIER('Table'[Year]) &&
'Table'[Day Number] <= EARLIER('Table'[Day Number])
)
)
Put Day Number on the X-axis of the line chart, Sum Sales on the Y-axis, and Year on the legend.
The final visual effect is as follows:
pbix file is attached.
If you have any further questions please feel free to contact me.
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
- Juances_172 years agoHelper I
Buen día,
De antemano les agradezco, la ayuda. Estuve intentando aplicar la solucion que me dieron a mi modelo, sin embargo, los resultados que obtuve no fueron los esperados. Inicalmente, a la tabla matriculas no le pude incluir el "Day Number" porque al tener fechas repetidas dado que en un mismo día podia haber mas de una venta, el conteo no me quedaba de forma correcta. Posteriormente, decidie crear una tabla alterna en excel eliminando los duplicados, la cual cargue y luego le asigne el "Day Number" usando la opcion indice de Power Query. Cree las medidas sugeridas pero al relacionar la nueva tabla con la de matrículas los resultados no fueron los esperados.
Me gustaria compartirles el link del reporte, para que con los datos reales me ayudaran a resolver la dificultad que tengo de una forma mas precisa.
Seguimiento matriculas v2 (Copia).pbix
Cordialmente,
Sebastian