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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ARP331AHS269
Frequent Visitor

Need help with splitting data

Hello,

 

I have data in the format

 

INCWKN
INC12345606-Mar-2023 07:49:24 - FirstName1 Lastname1 (Work notes)
Monitoring the server
06-Mar-2023 07:47:58 - FirstName2 Lastname2 (Work notes)
logs has been shared with vendor
02-Mar-2023 15:13:07 - FirstName3 Lastname3 (Work notes)
Waiting for the mass migration of VMs to be completed.
02-Mar-2023 13:30:25 - FirstName4 Lastname4 (Work notes)
Server is now updating the OS patching.
We will wait for this step to complete


 

I'll have to split this data into 

 

INCDate-TimeAgent NameNotes
INC12345602-03-2023 13:30FirstName1 Lastname1Monitoring the server
INC12345602-03-2023 15:13FirstName2 Lastname2logs has been shared with vendor
INC12345606-03-2023 07:47FirstName3 Lastname3Waiting for the mass migration of VMs to be completed.
INC12345606-03-2023 07:49FirstName4 Lastname4Server is now updating the OS patching.
We will wait for this step to complete

 

 

Please advise on how to achieve this 

1 ACCEPTED SOLUTION
ronrsnfld
Super User
Super User

If I understand your setup correctly:

ronrsnfld_0-1724328994844.png

this should work:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZBNT4NAEIb/yoSTJq2BXSi6VxMTE6mHJnJoOKxlChthl+yM5e+7JUIb7W0/Mu/zvLPfR9EqijfrQvu1iIWEOFfpkxIprOHFeOKt7jGBN01sp9Nd6fwXWMdI91G1muYLZw07b2wD3CIQ+hP6+fNveK6yx+twsYSLm+GdawhaTfCJaIFa7bGG0XALJ7S1u3DEhZNkKpEqzq85cuHI/5zX7XMiZJptQlCpDZ+rHJ2f6vSaCHrTeM3GWXBH+CgI2AUhOLh+6JCxfripIZWMlciuNdJFI71ZdzctDwyF9xG+h1rzvNf3HQyaD224L7gSwy66DsYg/WscRolxOBvOelFV/QA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [INC = _t, WKN = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"INC", type text}, {"WKN", type text}}),

//Replace INC space with nulls 
//  so can fill up/down
    #"Replace with nulls" = Table.ReplaceValue(
        #"Changed Type","",null,Replacer.ReplaceValue,{"INC"}),
    #"Filled Down" = Table.FillDown(#"Replace with nulls",{"INC"}),
    #"Filled Up" = Table.FillUp(#"Filled Down",{"INC"}),

//Extract the date-time into a column
// then fill down and group
    #"Added Custom" = Table.AddColumn(#"Filled Up", "Date-Time", each try DateTime.From(Text.Start([WKN],20)) otherwise null, type datetime),
    #"Filled Down1" = Table.FillDown(#"Added Custom",{"Date-Time"}),
    #"Grouped Rows" = Table.Group(#"Filled Down1", {"INC","Date-Time"}, {
    
    //extract Agent Name and Notes from each group
        {"Agent Name", each Text.Trim(Text.Middle(Splitter.SplitTextByDelimiter("(")([WKN]{0}){0},23)), type text},
        {"Notes", each Text.Combine(List.RemoveFirstN([WKN],1),"#(lf)"), type text}
        })
in
    #"Grouped Rows"

 

ronrsnfld_1-1724329038203.png

 

 

View solution in original post

2 REPLIES 2
ronrsnfld
Super User
Super User

If I understand your setup correctly:

ronrsnfld_0-1724328994844.png

this should work:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bZBNT4NAEIb/yoSTJq2BXSi6VxMTE6mHJnJoOKxlChthl+yM5e+7JUIb7W0/Mu/zvLPfR9EqijfrQvu1iIWEOFfpkxIprOHFeOKt7jGBN01sp9Nd6fwXWMdI91G1muYLZw07b2wD3CIQ+hP6+fNveK6yx+twsYSLm+GdawhaTfCJaIFa7bGG0XALJ7S1u3DEhZNkKpEqzq85cuHI/5zX7XMiZJptQlCpDZ+rHJ2f6vSaCHrTeM3GWXBH+CgI2AUhOLh+6JCxfripIZWMlciuNdJFI71ZdzctDwyF9xG+h1rzvNf3HQyaD224L7gSwy66DsYg/WscRolxOBvOelFV/QA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [INC = _t, WKN = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"INC", type text}, {"WKN", type text}}),

//Replace INC space with nulls 
//  so can fill up/down
    #"Replace with nulls" = Table.ReplaceValue(
        #"Changed Type","",null,Replacer.ReplaceValue,{"INC"}),
    #"Filled Down" = Table.FillDown(#"Replace with nulls",{"INC"}),
    #"Filled Up" = Table.FillUp(#"Filled Down",{"INC"}),

//Extract the date-time into a column
// then fill down and group
    #"Added Custom" = Table.AddColumn(#"Filled Up", "Date-Time", each try DateTime.From(Text.Start([WKN],20)) otherwise null, type datetime),
    #"Filled Down1" = Table.FillDown(#"Added Custom",{"Date-Time"}),
    #"Grouped Rows" = Table.Group(#"Filled Down1", {"INC","Date-Time"}, {
    
    //extract Agent Name and Notes from each group
        {"Agent Name", each Text.Trim(Text.Middle(Splitter.SplitTextByDelimiter("(")([WKN]{0}){0},23)), type text},
        {"Notes", each Text.Combine(List.RemoveFirstN([WKN],1),"#(lf)"), type text}
        })
in
    #"Grouped Rows"

 

ronrsnfld_1-1724329038203.png

 

 

bhanu_gautam
Super User
Super User

@ARP331AHS269 , Try spliting data using deliemter in Power Query




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

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.

Top Solution Authors