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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lukinfo
Frequent Visitor

Transform table - unfill with join text

I have a table that I want to transform as in the picture

excel1.png

I do reverse fill down (Unfill) using this metod:

https://www.youtube.com/watch?v=USwj-ueJOgc

 

excel2.png

I have this table but I don't know how do Info2 columnn? Is this posible to do ?

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@lukinfo 

Paste the below M code in a new query and check the steps:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k0sylbSUTI2ABKeeWn5Ci5KsTrRSkCeiRFMKAgmZGgJE3LGVOUOEwKbFZJaUaJgAtdoCBMyBwuF5OdVglSaAgmXxBIFR5hCIxOoCNxOYwuwSJFCCFyNGUgkNQ/q1JDMXJAN5lBBuMtMDaAijijOD88vQnK9OVQE7ngjiEgJQo0xWCQxT8EXxUnhidkgB8QCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Value = _t, Info = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Name"}),
    #"Filled Down" = Table.FillDown(#"Replaced Value",{"Name"}),
    #"Grouped Rows" = Table.Group(#"Filled Down", {"Name"}, {{"Count", each Text.Combine([Info],","), type nullable text}}),
    Custom1 = #"Replaced Value",
    #"Added Custom" = Table.AddColumn(Source, "Info2", each if Text.Length([Name]) > 0 then 
let nm = [Name] in  Table.SelectRows( #"Grouped Rows" , each [Name] = nm )[Count]{0}
 else "")
in
    #"Added Custom"

Fowmy_0-1700825363471.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@lukinfo 

Paste the below M code in a new query and check the steps:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8k0sylbSUTI2ABKeeWn5Ci5KsTrRSkCeiRFMKAgmZGgJE3LGVOUOEwKbFZJaUaJgAtdoCBMyBwuF5OdVglSaAgmXxBIFR5hCIxOoCNxOYwuwSJFCCFyNGUgkNQ/q1JDMXJAN5lBBuMtMDaAijijOD88vQnK9OVQE7ngjiEgJQo0xWCQxT8EXxUnhidkgB8QCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Value = _t, Info = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Name"}),
    #"Filled Down" = Table.FillDown(#"Replaced Value",{"Name"}),
    #"Grouped Rows" = Table.Group(#"Filled Down", {"Name"}, {{"Count", each Text.Combine([Info],","), type nullable text}}),
    Custom1 = #"Replaced Value",
    #"Added Custom" = Table.AddColumn(Source, "Info2", each if Text.Length([Name]) > 0 then 
let nm = [Name] in  Table.SelectRows( #"Grouped Rows" , each [Name] = nm )[Count]{0}
 else "")
in
    #"Added Custom"

Fowmy_0-1700825363471.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

lukinfo
Frequent Visitor

I'm impressed. This is exactly what I need. Thank you very much 🙂

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors