DAX - Create a table based on a condition

Viewed 21

I have the following table Table

enter image description here

Where Other Columns represent multiple other columns of the large Table. How can I create another table that contains only rows for person p1 and p3 who provided a comment, and only the first 3 columns (WITHOUT other multiple columns after column Person? The desired output should look like this

enter image description here

2 Answers
Table 2 = 
VAR comments = CALCULATETABLE( VALUES('Table'[Person]), 'Table'[Comment] <> "") 
VAR tbl = FILTER('Table', 'Table'[Person] = comments)
RETURN tbl

enter image description here

Table 2 = 
VAR comments = CALCULATETABLE( VALUES('Table'[Person]), 'Table'[Comment] <> "") 
VAR tbl = FILTER('Table', 'Table'[Person] IN comments)
RETURN SELECTCOLUMNS( tbl, "Score", 'Table'[Score], "Comment", 'Table'[Comment], "Person", 'Table'[Person])
Related