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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Cómo escribir M Language para marcar el año anterior el último día del año

Hola

Tengo una columna del día del año (01 - 365 o 01 - 366) y me preguntaba cómo conseguir que el último día del año anterior se marque como "Año anterior".

Básicamente como este pseudocódigo:

si (año anterior) [día del año] = 365 o (año anterior) [día del año] = 366 entonces "Año Anterior" más nulo

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@Niels_T , Último día del año anterior


Date.EndOfYear(Date.AddYears([fecha], -1))

Si la fecha es el año anterior

Date.IsInPreviousYear([Fecha])

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@Niels_T , Último día del año anterior


Date.EndOfYear(Date.AddYears([fecha], -1))

Si la fecha es el año anterior

Date.IsInPreviousYear([Fecha])

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.