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

October 28 & 29: Experts share their secrets on how to pass the Fabric Analytics Engineer certification exam—live. Learn more

Reply
Anonymous
Not applicable

CMA

 
1 ACCEPTED SOLUTION

@Anonymous , Did this solve the issue? If yes, Please mark this as solution

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Copy Paste This code in Power Query in a blank query

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8gtR0lEqKSpNzcxLB7IcHR2BpKGhkVKsDlQyragUIufk5AQkjYyMEXIpMDlnZ2cgaWxsApYL8wTx0lLTUoFUWVESkDQzM0WSSgUCEJVeBNJsbGKMJFecWlRSWQpkFCUVgc0EuiUWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [State = _t, TypeA = _t, TypeB = _t, NumA = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"State", type text}, {"TypeA", type text}, {"TypeB", type text}, {"NumA", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"State"}, {{"Data", each _, type table [State=nullable text, TypeA=nullable text, TypeB=nullable text, NumA=nullable number]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Index", each Table.AddIndexColumn([Data],"Index",1)),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Index"}),
    #"Expanded Index" = Table.ExpandTableColumn(#"Removed Other Columns", "Index", {"State", "TypeA", "TypeB", "NumA", "Index"}, {"State", "TypeA", "TypeB", "NumA", "Index.1"}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Expanded Index", {"State", "Index.1"}, "Attribute", "Value"),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Unpivoted Columns", {{"Index.1", type text}}, "en-US"),{"Attribute", "Index.1"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    #"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[Merged]), "Merged", "Value")
in
    #"Pivoted Column"

, apply and check 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@Anonymous , Did this solve the issue? If yes, Please mark this as solution

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

October NL Carousel

Fabric Community Update - October 2024

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