If your datagrid is set to ‘database’ as datasource you can't use an xpath to constrain the data. If you want to do this you need to set the datasource to ‘Xpath source’
With ‘database source’ you can however constraint the data with constraints
https://docs.mendix.com/refguide/data-grid#data-source-properties