On pages, it is (don’t ask me why) not possible to compare with attributes of the current Object. I think there is already an Idea in the idea forum about it. Feel free to support it.
Unfortunately, on a page, you can only compare to the object itself. If you need more, you need to select microflow as datasource.
I hope they will make attributes available in a future Mendix version (They can already be used in visibility constraints so they are available in the client should be possible to make them available in xpath).
This is the idea you may want to upvote: https://forum.mendix.com/link/ideas/659
You want to use
[%CurrentObject%] See the documentation here: https://docs.mendix.com/refguide/xpath-keywords-and-system-variables
hao to write xpath ?
The Grid Search widget package might be useful here.