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
Gaurav_84
Helper I
Helper I

Función Dax Generate

Hola Experto,

Por favor, ayúdame con la función de DAX a continuación se compartió conmigo en mi post más antiguo. ¿Hay alguna manera de lograr M-1 a partir de la fecha de vigencia.

Supongamos que si mi fecha de vigencia es 22/10/2020 con m-1 debe convertirse en 22/09/2020.

Gaurav_84_0-1603326033152.png

saludos

Gaurav

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hola, @Gaurav_84

Es un placer responder por ti.

Según su descripción, creo que puede definir una variable como 'm-1'date.

Así:

Measure = 
var dateymd=MAX('Table'[Effective date])
var year=YEAR(dateymd)
var month=MONTH(dateymd)-1
var day=DAY(dateymd)
var effevtivedate=DATE(year,month,day)
return effevtivedate

v-janeyg-msft_0-1603691833233.png

Si no resuelve su problema, por favor no dude en preguntarme.

Saludos

Janey Guo

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hola, @Gaurav_84

Es un placer responder por ti.

Según su descripción, creo que puede definir una variable como 'm-1'date.

Así:

Measure = 
var dateymd=MAX('Table'[Effective date])
var year=YEAR(dateymd)
var month=MONTH(dateymd)-1
var day=DAY(dateymd)
var effevtivedate=DATE(year,month,day)
return effevtivedate

v-janeyg-msft_0-1603691833233.png

Si no resuelve su problema, por favor no dude en preguntarme.

Saludos

Janey Guo

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

amitchandak
Super User
Super User

@Gaurav_84, no muy claro. Prueba esta fórmula

=
var _min -Minx(allselected(table),Table[[finish_dt]])
var _max á date(year(_min), month(_min)-1,day(_min))
devolución
devolución
calculate([measure], filter(Date, Date[Date] >-_min && Date[Date]>-_min))

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.