Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello,
I need to make a unique column to get a 1-to-1 relation with another column. I have the table below:
Header |
A |
A |
B |
B |
And the table I need is:
Header | Unique |
A | A1 |
A | A2 |
B | B1 |
B | B2 |
@AlbertPietens start a new blank query, click advanced editor, and copy this code. You can follow these steps in your data.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YGRTjAyFgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Header = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Header", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Header"}, {{"All", each Table.AddIndexColumn(_, "Rank", 1)}}),
#"Expanded All" = Table.ExpandTableColumn(#"Grouped Rows", "All", {"Rank"}, {"Rank"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded All",{{"Rank", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Unique", each [Header] & [Rank], type text),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Rank"})
in
#"Removed Columns"
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@AlbertPietens it will make more sense to do it in PQ, let me know if that is something you would like to do.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
80 | |
74 | |
63 | |
61 | |
45 |
User | Count |
---|---|
108 | |
97 | |
88 | |
81 | |
61 |