Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi, is there a way to add a new column into Table A:
if values from 3 columns in Table A exists in 1 column in Table B,
and the result would be the value from the 1 column in Table B
Something like
if ( contains (Table B, Column 1.B, Column 1.A and Column 2.A and Column 3.A), "Column 1.B", null))
but above code doesn't work.
Thank you.
Solved! Go to Solution.
I was too concentrated with using contain and lookup, that I forgot the the use of Filter. Here is the solution I was able to come up with, if anyone else has a more simple answer, please feel free to show it:
@msantillan , you need to try like
Countx(filter(Table2, CONTAINSSTRING(Table2[Col],Table1[Col1]) && CONTAINSSTRING(Table2[Col1],Table1[Col1]) ),Table2[Col1])
Bring results from Table 2 to table1.
This will a new column in table 1. any count means you condition matched.
https://docs.microsoft.com/en-us/dax/containsstring-function-dax
Hi @amitchandak I don't particularly get the solution. I'm trying to see if the three columns from Table 1 exists in the 1 column in Table 2. I then get the value from the 1 column in Table 2 into a new column in Table 1.
Hi @amitchandak I can't send a sample data. But here is the sample output in table format:
Table 1:
Reporter | Creator | Assignee | (New Column) |
Bill | Mark | Bill | Bill |
Mark | Tom | Tom | Tom |
James | Mark | James |
Table 2:
Resource Config |
Bill |
Tom |
James |
So, basically Table 1 will check if the names from Table 2 exists in either Reporter, Creator and Assignee. If it exists, the values from Table 2 will be extracted into the new column in Table 1
I was too concentrated with using contain and lookup, that I forgot the the use of Filter. Here is the solution I was able to come up with, if anyone else has a more simple answer, please feel free to show it:
User | Count |
---|---|
120 | |
69 | |
68 | |
57 | |
50 |
User | Count |
---|---|
166 | |
82 | |
68 | |
65 | |
54 |