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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
mahnoor1279
Frequent Visitor

Change multiple row value into column

Hey everyone i'm new to powerbi  and got stuck in a stiuation 

the data i've is 

Capture.PNG

 

 

 

 

 

And the result i want is

 

Capture1.PNG

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXL0BRJRQGxkYGSoa2Cka2gEEnVyVorVwaciPDjYBazECchxASlxhCsx1TU0BnIiIqPAKpyBbFQFJhAFjuFQM3CqcHL0C/WOBKtxAcmDiCBkp5iCnBICMcUVagqGWyMiQpRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Designation = _t, #"Manager Name" = _t, Date = _t, #"Client name" = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Name", "Designation", "Manager Name", "Date"}, {{"Client name", each Text.Combine([Client name],","), type nullable text}}),
    Custom1 = Table.SplitColumn(#"Grouped Rows", "Client name", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), List.Transform({1..List.Max(Table.AddColumn(#"Grouped Rows", "Temp", each List.Count(Text.Split([Client name],",")))[Temp])},each "Client name." & Number.ToText(_)))
in
    Custom1

 

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXL0BRJRQGxkYGSoa2Cka2gEEnVyVorVwaciPDjYBazECchxASlxhCsx1TU0BnIiIqPAKpyBbFQFJhAFjuFQM3CqcHL0C/WOBKtxAcmDiCBkp5iCnBICMcUVagqGWyMiQpRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Designation = _t, #"Manager Name" = _t, Date = _t, #"Client name" = _t]),
    #"Grouped Rows" = Table.Group(Source, {"Name", "Designation", "Manager Name", "Date"}, {{"Client name", each Text.Combine([Client name],","), type nullable text}}),
    Custom1 = Table.SplitColumn(#"Grouped Rows", "Client name", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), List.Transform({1..List.Max(Table.AddColumn(#"Grouped Rows", "Temp", each List.Count(Text.Split([Client name],",")))[Temp])},each "Client name." & Number.ToText(_)))
in
    Custom1

 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors