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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

suma de la reversión 12 meses de ventas

Hola

Estoy tratando de lograr una suma gradual de 12 meses de ingresos por ventas.

Tengo dos mesas:

Estas dos tablas se unen en función del campo de fecha.

Tabla-1

Weeknumber Fecha MonthNumber año
27 7/6/2019 7 2019
28 7/14/2019 7 2019

Tabla -2

Ingresos por ventas Fecha
3000 7/6/2019
4000 7/14/2019

Ahora quiero tener unas ventas de 12 meses basadas en el número de la semana:

para la semana ex. 2019 27 a 2020 semana 26

Intenté esta medida, pero obtengo el mismo valor que sales rvenue para todas las filas,

Medida-1 - Calcular(Sum(Tabla-1[Ingresos de ventas]),
DATESINPERIOD(Tabla-2[fecha],max(Tabla-2[fecha]),-12,MES))

Cualquier ayuda sobre cómo obtener estos 52 semanas de datos continuos

Gracias

Tejaswi

1 ACCEPTED SOLUTION

@tejaswidmello

Adjuntar el archivo

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

@tejaswidmello

Consulte este archivo. Utiliza el rango de la semana para hacer frente a la semana, semana anterior semana rodante

https://www.dropbox.com/s/bu47m5ek7sr9v8t/sales_analytics_v2.pbix?dl=0

Típicamente el mismo año de la semana es 364 Días detrás

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

HI @amitchandak ,

Gracias por su respuesta.

Voy a través de su expediente y tengo preguntas follinwg

1, ¿el campo Número de semana es el mismo que el rango de la semana que mentioedn?

2. y está utilizando la medida de balanceo 1 para obtener este resultado?

Aprecia tu respuesta.

Gracias

Tejaswi

@tejaswidmello

En la tabla de fechas; se refieren al rango de la semana.

Y refiérase a la página 1 y páginas sabias de la semana

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

@amitchandak ,

No hay campo como rango de semana en la tabla de fechas.

ni hay datos de la semana en las páginas.

¿Me estoy perdiendo algo?

Gracias

Tejaswi

@tejaswidmello

Adjuntar el archivo

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hola @amitchandak ,

Dado que mi fecha no está en formato conituoso, no puedo utilizar la función DATEADD, ya que me da un error.

¿Qué alternativa podría ser posible? ¿puedo usar datesinperiod?

ya que estoy tratando de volver 52 semanas de retraso para obtener los últimos 12 meses rodando datos de la semana.

Gracias

Tejaswi

@tejaswidmello , debe crear un calendario de fechas y unirse a eso. Y ahí se puede utilizar dateadd.

La otra manera es

Rolling 12 =
var _max = maxx('Sales','Sales'[Date])
var _min = date(year(_max),month(_max),day(_max)-364)
//Or
//var _min = date(year(_max)-1,month(_max),day(_max))

return
CALCULATE(SUM('Sales'[Sales]), FILTER(all('Sales'), 'Sales'[Date]<=_max && 'Sales'[Date]>=_min))
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

HI @amitchandak ,

Tengo datos de fecha en una tabla diferente y se une a mi tabla de ventas, sin embargo, no es continuo.

También soy gettign valor correcto cuando intento con su rango de la semana de fórmula, mi última semana y las últimas 12 semanas datos vienen correctos con su fórmula, Sin embargo, los últimos 52 años datos son incorrectos.

Probé la fórmula que acabas de dar, pero obteniendo diferentes valores..

Gracias,'Tejaswi

Anonymous
Not applicable

Hola @amitchandak ,

Modifiqué tu última medida de 12 semanas para mostrar los datos de 52 semanas y funcionó para mí.

Muchas gracias por su ayuda!

Gracias

Tejaswi

Anonymous
Not applicable

Gracias @amitchandak ,

Faltaba este archivo. Iré a través de las fórmulas y la lógica y me llamaré a usted para cualquier pregunta.

Gracias

Tejaswi

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors