So, I'd guess you would want to set the ID field with something like this:
xdXDocument:GetDOM("Teams_roster")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[count(current()/../preceding-sibling::my:group2) + 1][d:Dept = XPATH TO YOUR DEPT FIELD]/d:ID
With the bold part being the main data source field (or other field) bound to the dropdown list. Of course, it seems like you also could just not query your data on load, and instead query for just the data you need when the department dropdown changes? Set the list query field & execute the query?