I'm in Power BI trying to add a calculated column.
I've got two tables, and a join between them: 1:n.
Table 1:
<tbody>
</tbody>
Table 2:
<tbody>
</tbody>
I can join them together like this:
<tbody>
</tbody>
As we can see, ID 3 in Table 1 does not have a corresponding ID in Table2
So what I am trying to do, is add a calculated column to using a SWITCH() function to get this:
<tbody>
</tbody>
Here is my code:
SwitchColumn = SWITCH(RELATED('Table1'[ID]), BLANK(), 'Table2'[Name], 'Table1'[Description])
However, its not working. What DAX code should I be using here? Thanks.
I've got two tables, and a join between them: 1:n.
Table 1:
ID | Description |
1 | Bing |
2 | Bang |
3 | Bong |
<tbody>
</tbody>
Table 2:
ID | Name |
1 | Joe |
2 | Fred |
<tbody>
</tbody>
I can join them together like this:
ID | Description | ID | Name |
1 | Bing | 1 | Joe |
2 | Bang | 2 | Fred |
3 | Bong |
<tbody>
</tbody>
As we can see, ID 3 in Table 1 does not have a corresponding ID in Table2
So what I am trying to do, is add a calculated column to using a SWITCH() function to get this:
ID | Description | ID | Name | SwitchColumn |
1 | Bing | 1 | Joe | Joe |
2 | Bang | 2 | Fred | Fred |
3 | Bong | Bong |
<tbody>
</tbody>
Here is my code:
SwitchColumn = SWITCH(RELATED('Table1'[ID]), BLANK(), 'Table2'[Name], 'Table1'[Description])
However, its not working. What DAX code should I be using here? Thanks.