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
BobKoenen
Helper IV
Helper IV

Editor de consultas de Power BI M Else if instrucción basada en la columna de fecha

Quiero crear una nueva columna en el editor de consultas, pero no puedo averiguar la fórmula correcta, espero que pueda ayudarme.

Tengo una columna de fecha [FactuurdatumFA]. Quiero una segunda columna - Si la fecha de [factuurdatumFA] <- 31-1-2020 Entonces sólo quiero la fecha de [factuurdatumFA], de lo contrario quiero la fecha de [factuurdatumFA] -1 mes.

He creado esta fórmula,

si [Factuurdatum_FA] <-#date(31,1,2020) entonces [Factuurdatum_FA] else Date.AddMonths([Factuurdatum_FA],-1)

pero da el error: La fecha-edición ha fallado porque el valor resultante está fuera del intervalo de fechas permitido

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

Hola @BobKoenen

Pruebe algo como esto a continuación:

= Table.AddColumn(#"Changed Type", "Custom", each if [Date] <= #date(2019, 1, 1) then [Date] else Date.AddMonths([Date], -1))

9.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hola @BobKoenen

Pruebe algo como esto a continuación:

= Table.AddColumn(#"Changed Type", "Custom", each if [Date] <= #date(2019, 1, 1) then [Date] else Date.AddMonths([Date], -1))

9.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

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.