0
votes

I have three different tables. I want to select different columns from each of the tables and create one table based on some filters. Have a look at the following dax expression:

FILTER(DISTINCT(SELECTCOLUMNS(Test_Table,"site_key",[site_key],"is_active",[is_active])),[is_active]=TRUE&&[dbsource]=="DB2")

As you can see, I've selected olumns from Test_Table. Firstl, How can I add columns from the other two tables? Secondly, Please note that these tables are related so I've created a relationship between them based on relevant IDs. Will I have to create a natural join in DAX as well?

1
I'd recommend SUMMARIZECOLUMNS in general for this sort of thing.Alexis Olson
@AlexisOlson Can you place it in the dax expression to explain?Ali Mojiz
Maybe if you explain what other columns you'd like to include and how they're related to Test_Table.Alexis Olson
@AlexisOlson another table test_table_2 having a relationship on site_key with Test_Table. Test_Table_2 contans columns by the name of industry_group, country and state.Ali Mojiz

1 Answers

0
votes

As I mentioned in the comment, SUMMARIZECOLUMNS can probably get you what you're looking for. It might look something like this in your case:

SUMMARIZECOLUMNS (
    Test_Table[site_key],
    Test_Table_2[industry_group],
    Test_Table_2[country],
    Test_Table_2[state],
    FILTER ( Test_Table, [is_active] = TRUE && [dbsource] = "DB2" )
)