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
meenakp
Resolver I
Resolver I

Se necesita ayuda para formatear la fecha

Hola

Desde un campo de texto tengo que recuperar Fecha [si los primeros caracteres consisten en fecha sembrada por "/" ]

IDATETEXT_1 es una columna de tipo de texto que intenta derivar la fecha de ItemText Field. De lo contrario, el valor predeterminado es fecha ficticia.

Estoy creando otra columna llamada IDATE como abajo- cuyo tipo de columna establecido como FECHA. [ Para ser utilizado para cálculos]

IDATE á iferror(DATEVALUE(IDATEETEXT_1),30/12/1899)

El desafío es que algunos valores mezclan la fecha y el mes como se resalta a continuación. Quiero que parezca como IDATETEXT1 pero en el tipo DATE. Por favor, sugiera una solución.

El texto del elemento consta de dd/mm/aaaa - y quiero que el mismo se refleje también en IDATE.

20/07/2020 está justo en el ejemplo siguiente.

meenakp_1-1606965521046.png

Gracias

3 REPLIES 3
meenakp
Resolver I
Resolver I

@CNENFRNL, Gracias por sus comentarios. ¿Tenía que hacer alguna configuración regional en esta columna o informe por favor?

No funcionó para mí tan suave como tú.

Pero pude moverme con DAX - format(DATEVALUE(IDATEETEXT_1),"dd/mm/aaaa") - No hay configuración regional en el informe.

Hola, @meenakp

¿La respuesta de CNENFRNL le ayudó a resolver su problema?

Si su respuesta le ayuda a resolver su problema, ¿le gustaría marcar su respuesta como una solución para que otros puedan aprender de ella también?

Gracias de antemano!

Saludos

Equipo de apoyo a la comunidad _Robert Qin

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

CNENFRNL
Community Champion
Community Champion

Hola, @meenakp , Power Query nace para un trabajo de limpieza de datos de este tipo; tal vez quieras intentarlo,

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjLVNzTUNzIwMlAICFGK1YlWMrTUNzQAi4C5ymDS2FDPwFwPqCg4DMw3stQzMNKDKjEwh+mAmWFkoA8UhIj4o6lRio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Item Text" = _t]),
    #"Retrieved Date" = Table.AddColumn(Source, "IDATE", each try Date.From(Text.BeforeDelimiter([Item Text], " "), "en-GB") otherwise #date(1899,12,30), type date)
in
    #"Retrieved Date"

Screenshot 2020-12-03 050949.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

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.