- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Transformation Help Required in Power Query
I have a data in a certain format and it needs to be converted properly in Power query editor.
I tried using unpivot, Transpose and pivot operations.
But somehow im not able to transform it properly.
INPUT:
EXPECTED OUTPUT:
It will be great if somebody can solve this and explain step by step.
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Imagauthamam - In Power Query Editor and achieve the expected output as like below:
Mcode:
let
// Load the source data
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8nRRitWJVvJLzE0FM3zykxNLMvPzwBxDMBmcmAuVykuBShhBJErzUhKLIPpTyxUi84uywRxjMOmYAtXnkpqTkakUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
// Change column type
ChangedType = Table.TransformColumnTypes(Source, {{"Column1", type text}}),
// Add Index Column
AddIndex = Table.AddIndexColumn(ChangedType, "Index", 0, 1, Int64.Type),
// Create a Custom Column for Type
AddedCustom = Table.AddColumn(AddIndex, "Type", each if Number.Mod([Index], 3) = 0 then "ID" else if Number.Mod([Index], 3) = 1 then "Name" else "Location"),
#"Pivoted Column" = Table.Pivot(AddedCustom, List.Distinct(AddedCustom[Type]), "Type", "Column1"),
#"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Index"}),
#"Removed Top Rows" = Table.Skip(#"Removed Columns",1),
#"Filled Down" = Table.FillDown(#"Removed Top Rows",{"ID", "Name", "Location"}),
#"Removed Duplicates" = Table.Distinct(#"Filled Down"),
#"Removed Duplicates1" = Table.Distinct(#"Removed Duplicates", {"Name"}),
#"Removed Top Rows1" = Table.Skip(#"Removed Duplicates1",1)
in
#"Removed Top Rows1"
Hope this helps
Proud to be a Super User! | |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can be done in a single step
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
Custom1 = Table.FromRows(List.Split(Table.Skip(Source,3)[Column1],3),Table.FirstN(Source,3)[Column1])
in
Custom1
Hope this helps.
Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Can be done in a single step
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
Custom1 = Table.FromRows(List.Split(Table.Skip(Source,3)[Column1],3),Table.FirstN(Source,3)[Column1])
in
Custom1
Hope this helps.
Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Imagauthamam - In Power Query Editor and achieve the expected output as like below:
Mcode:
let
// Load the source data
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8nRRitWJVvJLzE0FM3zykxNLMvPzwBxDMBmcmAuVykuBShhBJErzUhKLIPpTyxUi84uywRxjMOmYAtXnkpqTkakUGwsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
// Change column type
ChangedType = Table.TransformColumnTypes(Source, {{"Column1", type text}}),
// Add Index Column
AddIndex = Table.AddIndexColumn(ChangedType, "Index", 0, 1, Int64.Type),
// Create a Custom Column for Type
AddedCustom = Table.AddColumn(AddIndex, "Type", each if Number.Mod([Index], 3) = 0 then "ID" else if Number.Mod([Index], 3) = 1 then "Name" else "Location"),
#"Pivoted Column" = Table.Pivot(AddedCustom, List.Distinct(AddedCustom[Type]), "Type", "Column1"),
#"Removed Columns" = Table.RemoveColumns(#"Pivoted Column",{"Index"}),
#"Removed Top Rows" = Table.Skip(#"Removed Columns",1),
#"Filled Down" = Table.FillDown(#"Removed Top Rows",{"ID", "Name", "Location"}),
#"Removed Duplicates" = Table.Distinct(#"Filled Down"),
#"Removed Duplicates1" = Table.Distinct(#"Removed Duplicates", {"Name"}),
#"Removed Top Rows1" = Table.Skip(#"Removed Duplicates1",1)
in
#"Removed Top Rows1"
Hope this helps
Proud to be a Super User! | |

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
07-01-2024 06:44 PM | |||
05-28-2024 11:34 AM | |||
09-07-2023 09:33 PM | |||
07-27-2023 05:31 AM | |||
01-28-2022 01:59 AM |
User | Count |
---|---|
88 | |
74 | |
63 | |
48 | |
36 |
User | Count |
---|---|
118 | |
86 | |
80 | |
58 | |
40 |