Forum Discussion
Anonymous
7 years agoNot applicable
Multi Column Relationships in the same table
Hi All, First post, I have looked for a previous answer on this and havent found something that fits. I cant have multiple active relationships on the same table to multiple columns. I am tryin...
- 7 years ago
try like this:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XY3LCQAxCER78ZyL31qSlfTfxo6ysCGDhyc+nExiGqTC5gGo2SNJAE8HMDsAFi2tBMW6Oqfw/SnBTuH/XycHiF6NcRWFeZ/2Cw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [UID = _t, A = _t, B = _t, C = _t]), ChangedType = Table.TransformColumnTypes(Source,{{"UID", Int64.Type}, {"A", type text}, {"B", type text}, {"C", type text}}), AddIDCol = Table.AddColumn( ChangedType, "ID", each if [C] <> "" then [C] else if [B] <> "" then [B] else [A], type text ) in AddIDCol
Anonymous
7 years agoNot applicable
Thank you for your help and reply. I am trying to understand where in your code that it checkes the value in the TableB column to one of those sought from the table A [Key] column.
LivioLanzo
7 years agoSolution Sage
Hi spider, the code consolidates into column your IDs in order to create a collumn that you can relate to the other table in your data model. is that now what you were after?
- Anonymous7 years agoNot applicable
It could be! I will try to implement what you have provided. I had to simplify and obfuscate a few things to ensure security.