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
bwhitlock
Helper II
Helper II

Calcular compras en un mes 9 meses adelante a partir de hoy

Estoy teniendo un problema con mi medida cuando cruza años. Estoy tratando de calcular mi compra total en un mes 9 mesa a partir de este mes. Puedo calcular 2 o 3 meses hacia adelante, pero cuando las transiciones a través de los años lo arruinan... ¿Cómo averibo cuál debe ser el intervalo de fechas en el mes 9 meses a partir de este mes?

Gracias a todos por adelantado

5 REPLIES 5
amitchandak
Super User
Super User

Así

Medida ?
var _max hoy()
var _min á date(year(_max),month(_max)+9,day(_max))
devolución
calculate([measure],filter(All(DATE), Date[Date] >-_min && Date[Date] <-_max))

O
Medida ?
var _max á eomonth(today(),1)+1
var _min á eomonth(date(año(_max),month(_max)+9,1) ,0)
devolución
calculate([measure],filter(All(DATE), Date[Date] >-_min && Date[Date] <-_max))

O

Medida ?
var _max á maxx(allselected('Date'),'Date'[Date])
var _min á date(year(_max),month(_max)+9,day(_max))
devolución
calculate([measure],filter(All(DATE), Date[Date] >-_min && Date[Date] <-_max))

Ashish_Mathur
Super User
Super User

Hola

Pruebe esta medida

• Calcular ([your_measure], Fechas entre (Calendario [Fecha], Edate (Eomonth (Hoy (),-1) + 1), 9),Edate (Eomonth (Hoy (), 0), 9)

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Gracias por el brillo. Tuve que hacer un ligero ajuste, ya que creo que tienes un padre extra

Calcular ([Tot Open PO Each Qty], Datesbetween (' Tabla de calendario ' [Fecha], Edate (Hoy (Hoy (),-1) + 1.9), Edate (Eomonth (Hoy (), 0), 9))

De nada. Si mi respuesta ayudó, por favor márquela como Respuesta.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Employee
Employee

¿Has probado DATEADD()? Esto supone que tiene un calendario de fechas denominado Calendario y está marcado como Tabla de fechas.

Medida: Calculate([YourMeasure], DATEADD(Calendar[Date], 9, month))

Si esto funciona para usted, por favor márquelo como solución. Los felicitaciones también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.