Question: So I'm using TFS,
and I have a query that returns PBIs and Tasks in a collapsed view.

That's the Query:

```
Team Project    =   @Project

And Iteration Path  Under   SO Suite\9.0\SFDC\Sprint_2015_02\Sveta

And Assigned To =   @Me

And Work Item Type  In  Product Backlog Item , Sprint Backlog Task

```

That's the result, in which you can spot, there are items which are assigned to multiple members:

![enter image description here](https://i.stack.imgur.com/Fan54.png)

Now, the PBI is assigned to me, so I guess that's why it include tasks from other members, but is there any way to filter such tasks out, and get the PBI with my Tasks only in the collapsed way?

any help would be appreciated.

Answer: 
When you use the Work Item and Direct Links or the Work Item Tree query types you get two queries. One for the top level and one for sub items.

In the UI when you edit the query you should see two queries. If you change the bottom one to show Assigned to = @me you can filter the sub items as well...
I'm guessing you used an OR clause for the two different work item types. If so you need to put parentheses around those two clauses in order to get the order of operations correct.

Alternatively, you can use one clause and do WorkItemType IN PBI, Task.

If this doesn't work, update your question with a screenshot of your query definition.