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
Dear all,
I have a need and did not find a solution.
let's say I have Family of product, each of them contains a population of items.
I must calculate the % of common items between each family. I'd like to represent it under a triangle matrix with the Family list on both dimensions.
For this I am thinking about create a table of Family couple and then create a calculated row in PBI to count my common items; Is it possible to do this in power query? I tried with duplicate column, unpivoting, transposed, but cannot find a solution.
Here is an illustration:
The current table :
Family
A
B
C
The expected couple table :
Family_1 Family_2
A A
A B
A C
B A
B B
B C
C A
C B
C C
Thanks a lot,
Solved! Go to Solution.
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately.)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Family = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Source[Family]),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
#"Expanded Custom"
Worked very well,
Thanks again @Vijay_A_Verma
Have a nice day
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test (later on when you use the query on your dataset, you will have to change the source appropriately.)
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Family = _t]),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Source[Family]),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
#"Expanded Custom"
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 |
---|---|
29 | |
12 | |
12 | |
11 | |
8 |
User | Count |
---|---|
54 | |
27 | |
15 | |
14 | |
13 |