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
o59393
Post Prodigy
Post Prodigy

Cómo obtener el año + 1 de cualquier fecha

Hola a todos

¿Cómo puedo obtener una fecha con el año siguiente para una fecha determinada utilizando columnas calculadas?

Por ejemplo, si tengo una fecha 4/14/2019, ¿cómo puedo haber devuelto el 4/14/2020?

Sumar 365 a 4/1/4/2019 sería lo más obvio que se puede hacer, pero este año tuvimos un salto.

Gracias.

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hola @o59393 ,

¿Tiene una dimensión de fecha? Puede utilizar la función CALENDAR() para crear una dimensión de fecha y establecer relaciones entre esta tabla y la tabla de hechos. Entonces podrías usar DATEADD() para obtener year+1.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
jdbuchanan71
Super User
Super User

@o59393

Prueba esto.

Next Year Date = DATE ( YEAR ( [Date] ) +1, MONTH ( [Date] ), DAY ( [Date] ) )

Hola @jdbuchanan71

Recibí este error:

#error.JPG

¿Cómo puedo resolverlo? El inicio del mes está en formato de fecha.

Gracias.

¿Su columna [StartMonth] contiene una fecha?

Yeap:

sadsasasa.JPG

¡Gracias!

Pruébelo con el DATEADD en su lugar.

Next Year Date = DATEADD ( [StartMonth], 1, YEAR )

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.