cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Merge rows

Hi,

 

I have this data

POWERBI.PNG

 

How can i merge de rows and obtain one row with this structure:

idticketfecharegistro1fecharegistro2fecharegistro5fecharegistro7
121926/11/201530/11/201530/11/201511/04/2016

 

in according with the "estatus"

 

Regards

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Merge rows

@abelrmg

 

You just need to create a custom column to append "Date" with estatus, then directly pivot on that column. See my sample below:

 

Capture.PNG

 

Regards,

View solution in original post

6 REPLIES 6
Highlighted
Community Champion
Community Champion

Re: Merge rows

I would first consider why you want to do this.  You can get to that format with your Power BI visuals, but leaving the data unpivoted gives you the greatest flexibility.

Highlighted
Community Champion
Community Champion

Re: Merge rows

Agree with @Ross73312

 

Should you still want to go ahead, then it can be done with Power Query (M). The following code was created via standard menu options; the last step with advanced option "Don't Aggregate".

 

let
    Source = Table1,
    #"Removed Columns" = Table.RemoveColumns(Source,{"idCliente", "idUsuarioRegistro"}),
    #"Added Prefix" = Table.TransformColumns(#"Removed Columns", {{"estatus", each "fecharegistro" & _, type text}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Prefix",{{"fechaRegistro", type date}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[estatus]), "estatus", "fechaRegistro")
in
    #"Pivoted Column"
Specializing in Power Query Formula Language (M)
Highlighted
Helper II
Helper II

Re: Merge rows

Hi @Ross73312, i want to do this because i will calculate time between dates.

 

Highlighted
Helper II
Helper II

Re: Merge rows

Hi @MarcelBeug the query send this error

 

Expression.Error: The column 'idCliente' of the table wasn't found.
Details:
idCliente

 

Regards

Highlighted
Community Champion
Community Champion

Re: Merge rows

Still easy to do in the current format.  Create some sort of index marker and do your calculations.

Highlighted
Microsoft
Microsoft

Re: Merge rows

@abelrmg

 

You just need to create a custom column to append "Date" with estatus, then directly pivot on that column. See my sample below:

 

Capture.PNG

 

Regards,

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors