Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
HELP!
I want to create a new table like I've created in an Excel. I've made a yellow table(right) from a pivot table(left).
I will appreciate your help!
Hi @hello_MTC ,
First you must pivot columns and then unpivot columns.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Hi @hello_MTC ,
Here is my m code. Go to Power Query, select New Source, Blank Query, and then go to Advanced Editor, and paste this code there. You will see the table that I dummied up and the various steps.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwVNJRMlSK1QGxjRBsQxDbCMoGqTGGsE3NgGwTCNvSEsKOBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, #"Count of User ID" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Count of User ID", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"ID", "Events ID"}}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Renamed Columns", {{"Count of User ID", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Renamed Columns", {{"Count of User ID", type text}}, "en-US")[#"Count of User ID"]), "Count of User ID", "Events ID", List.Count),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Pivoted Column", {}, "Attribute", "Value"),
#"Renamed Columns1" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "User Count"}, {"Value", "Event Counts"}})
in
#"Renamed Columns1"
Proud to be a Super User!
No, this is not what I want but thank you so much for your efforts. I really appreciate it.
I am very close to complete this process.
This is what I need in new table.
I am just figuring out how will I get those count of user id in new column.
Hi @hello_MTC ,
There are two simple methods to achieve the outcome:
Power Query
1. duplicate/reference the existing table,
2. then use group by:
.2a. Home > Group By:
Power BI report
pivot table in Power Bi
Regards
KT
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
35 | |
16 | |
12 | |
11 | |
9 |
User | Count |
---|---|
45 | |
25 | |
16 | |
14 | |
14 |