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

3015 Año - FECHA INFINITA

Hola a todos,

Tengo un proyecto power bi en el que empiezo a trabajar y el modelo devuelve la fecha infinita (hasta 3015 años).

Esta tabla de datos tiene 2 relaciones entre la tabla Fecha de pedido y Fecha de posición de stock. Sin embargo, las 2 tablas (fecha de pedido y fecha de posición de stock) contienen solo fechas hasta este mes/año (noviembre /2020).

¿Puedes ayudarme a encontrar por qué el power bi devolver fechas infinitas?

El código Dax que estoy usando es el siguiente a continuación.

FECHA DE LA FECHA ?
ADDCOLUMNS(
CALENDARAUTO (),
"CY", YEAR([Date]),
"Nombre del mes", FORMAT ( [Fecha], "mmm" ),
"Mes Número", MES( [Fecha] ),
"Weekday", FORMAT ( [Fecha], "dddd" ),
"Número de día de semana", WEEKNUM( [Fecha] ),
"Mes actual",
SI (
Año ( [Fecha] ) - Año ( HOY () )
&& MES ( [Fecha] )
• MES ( HOY () ) - 1,1,0
),
"Último tres meses",
VAR _dDiff ?
DATEDIFF ( [Fecha], HOY (), MES )
DEVOLUCION SI ( _dDiff > 0 && _dDiff < 4, _dDiff, 100 ),
"Last Three Month Tag",
VAR _dDiff ?
DATEDIFF ( [Fecha], HOY (), MES )
devolución
SWITCH (
VERDADERO (),
_dDiff > 0
&& _dDiff < 2, "Mes actual - "
& FORMAT ( FECHA ( "2000", MES ( HOY () ) - 1, "01" ), "mmmm" ),
_dDiff > 0
&& _dDiff < 3, "Mes anterior - "
& FORMAT ( FECHA ( "2000", MES ( HOY () ) - 2, "01" ), "mmmm" ),
_dDiff > 0
&& _dDiff < 4, "Mes Antes - "
& FORMAT ( FECHA ( "2000", MES ( HOY () ) - 3, "01" ), "mmmm" ),
"Ninguno"
),
"Cuarto", "Q"
& TRUNC ( ( MES ( [Fecha] ) - 1 ) / 3 ) + 1,
"TEST", MES ( [Fecha] ),
"TEST2", IF ( MES ( [Fecha] ) < 6, 1, 0 ),
"Año Financiero 1", CONCATENAR (
"FY",
SI (
MES ( [Fecha] ) <-6,
VALOR ( FORMAT ( [Fecha], "AAAA" ) ),
VALOR ( FORMAT ( [Fecha], "AAAA" ) ) + 1
)
),
"Ejercicio Financiero", IF (
MES ( [Fecha] ) > 6,
Año ( [Fecha] ) & "-"
& Año ( [Fecha] ) + 1,
Año ( [Fecha] ) - 1 & "-"
& Año ( [Fecha] )
),
"Year Month",FORMAT([Date],"AAAA")&"-"&FORMAT([Fecha],"MMM"),
"Actual FY",
VAR __d ?
HOY ()
DONDE __y ?
Año ( __d )
__startDate de beS ?
IF ( __d < DATE ( __y, 7, 1 ), DATE ( __y - 1, 7, 1 ), DATE ( __y, 7, 1 ) )
__endDate de beS ( BE __endDate)
IF ( __d > DATE ( __y, 6, 30 ), DATE ( __y + 1, 6, 30 ), DATE ( __Y, 6, 30 )
devolución
IF ( [Fecha] > __startDate && [Fecha] <- __endDate, "Sí", "No" )
)

Gracias.

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@fabiolamelo

Elimine la tercera línea del código CALENDARAUTO y sustitúyalo por lo siguiente

CALENDARIO(DATE(2000,1,1),DATE(2020,12,31))

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
fabiolamelo
Helper II
Helper II

@Fowmy Thank you so much

Fowmy
Super User
Super User

@fabiolamelo

Elimine la tercera línea del código CALENDARAUTO y sustitúyalo por lo siguiente

CALENDARIO(DATE(2000,1,1),DATE(2020,12,31))

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.