Scenario:
Suppose we have a Sample dataset as follows:
Now we can transpose the Rows to Columns using the following M-Query:
Suppose we have a Sample dataset as follows:
Now we can transpose the Rows to Columns using the following M-Query:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Ncq5DQAgDMDAXVLTkGcCNqBF2X8NCFYqSyefI3uuKaOixCTHY4UVrnw22GDr22GHvTnggCuZFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Col1 = _t, Col2 = _t, Col3 = _t]),
TransData =
Table.FromColumns(Table.ToRows(Source), {"TransCol1","TransCol2","TransCol3", "TransCol4", "TransCol5"}),MultiCustCols =
Table.AddColumn(TransData, "Stats", each
[
RowsCount = Table.RowCount(TransData),
ColumnsCount = Table.ColumnCount(TransData)
]
),
ExpandCols = Table.ExpandRecordColumn(MultiCustCols, "Stats", {"RowsCount", "ColumnsCount"}, {"RowsCount", "ColumnsCount"})
in
ExpandCols
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. If you wish, please share your genuine Feedback or comments only related to this Blog Posts. It is my humble request that, please do not post any Spam comments or Advertising kind of comments, which will be Ignored.