Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
tangutoori
Helper III
Helper III

data transform

Dear Team,

 

pls try to solve the below scenario.

 

SOURCE           
NameFieldPreviousCurrentChange Date       
NarenAge242516-03-22       
NarenLocationIndiaUSA16-03-22       
NarenVehicleTayotaHonda18-03-22       
RajeshNo of Kids0119-03-20       
RajeshNo of Kids1219-03-22       
RajeshStatusactiveinactive19-03-22       
OUT PUT           
NameChange DateAge PreviousAge CurrentLocation PreviousLocation CurrentVehicle PreviousVehicle CurrentNo of Kid PreviousNo of Kid CurrentStatus PreviousStatus Current
Naren16-03-222425IndiaUSA      
Naren18-03-22    TayotaHonda    
Rajesh19-03-20      01  
Rajesh19-03-22      12ActiveInactive

 

Regards,

Narender.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@tangutoori , In Power Query, Paste this code in a blank Query

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8kssSs1T0lFyTE8FkkYmIMIUSBia6RoY6xoZKcXqIBT55CcnlmTmg5ieeSmZiUA6NNgRl+qw1IzM5ByQsSGJlfklINUe+XkpINrQAkl9UGJWanEGUNQvXyE/TcE7M6UYyDEAKQNhS7BSAzxKQcqMEErRTA0uSSwpBSlLTC7JLAM5JzMPzkRoiQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Field = _t, Previous = _t, Current = _t, #"Change Date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Field", type text}, {"Previous", type text}, {"Current", type text}, {"Change Date", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name", "Field", "Change Date"}, "Attribute", "Value"),
    #"Merged Columns" = Table.CombineColumns(#"Unpivoted Columns",{"Field", "Attribute"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    #"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[Merged]), "Merged", "Value", List.Max)
in
    #"Pivoted Column"

 

Or refer to file attached

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@tangutoori , In Power Query, Paste this code in a blank Query

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8kssSs1T0lFyTE8FkkYmIMIUSBia6RoY6xoZKcXqIBT55CcnlmTmg5ieeSmZiUA6NNgRl+qw1IzM5ByQsSGJlfklINUe+XkpINrQAkl9UGJWanEGUNQvXyE/TcE7M6UYyDEAKQNhS7BSAzxKQcqMEErRTA0uSSwpBSlLTC7JLAM5JzMPzkRoiQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Field = _t, Previous = _t, Current = _t, #"Change Date" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Field", type text}, {"Previous", type text}, {"Current", type text}, {"Change Date", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Name", "Field", "Change Date"}, "Attribute", "Value"),
    #"Merged Columns" = Table.CombineColumns(#"Unpivoted Columns",{"Field", "Attribute"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    #"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[Merged]), "Merged", "Value", List.Max)
in
    #"Pivoted Column"

 

Or refer to file attached

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

thaks a lot. its working

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.