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
Anonymous
Not applicable

Estado Cambia las filas a la columna

Hola

Estaba tratando de poner los valores de los cambios de estado con fechas para una tarea de filas a columnas. Para poder usar funciones DAX para crear columnas calculadas. Esto es lo que tengo actualmente:

NombreEstadoFecha
A1S11/1/2016
A1S21/5/2016
A1S31/9/2016
A1S41/13/2016
A2S11/17/2016
A2S21/21/2016

¿Cómo puedo convertir esto a:

NombreS1. FechaS2. FechaS3. FechaS4. Fecha
A11/1/20161/5/20161/9/2016#######
A2#######1/21/2016

De esta manera puedo escribir DAX para escribir cualquier columna calculada. Actualmente tener datos para una tarea en cada fila hace que sea muy complicado escribir columnas calculadas. ¿Alguna idea?

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hola @saki999 ,

Puede seleccionar la columna"Estado"y "Fecha"y pivotar estas dos columnas:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcjRU0lEKBhGG+ob6RgaGZkqxOjBhI7CwKbqwMVjYEl3YBGKIMZK4EZLh5ujiENONYLbGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Status = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Status", type text}, {"Date", type date}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Status]), "Status", "Date")
in
    #"Pivoted Column"

piovt.JPG

Saludos

Rena

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

Hola @saki999 ,

la operación que está buscando se llama "Columnas de unpivot", Reza Rad describe esta función en su entrada de blog https://radacad.com/pivot-and-unpivot-with-power-bi.

Con suerte, esto es lo que estás buscando.

saludos

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.