Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 trying to avoid a bridge table if possible.
So i am hoping that you Datanauts might be able to help.
The challenge.
I have two tables. Table A contains a column that has a number of unique keys. Table B has a number of columns, the key value could appear in any one of three or not at all.
I was thinking that a custom column with an IF style logic of
ID = IF TableA[KEY] matches TableB[Col1] then =TableB[Col1] else
IF TableA[KEY] matches TableB[Col2] then =TableB[Col2] else
IF TableA[KEY] matches TableB[Col3] then =TableB[Col3] else
="No Member"
Hopefully that makes sense from a logic perspective i am stuggling with the syntax.
Solved! Go to Solution.
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
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |