Hello Pranay,
Sounds like a very odd issue. If what you're doing is valid I would assume that your dataview doesn't subscribe to its parent's updates.
I would suggest you first debug your refresh microflow, and check the variable tab in the debugger to make sure you are refreshing the right entity, and if you are, I would retrieve the entity used in dataview "Y" itself, and refresh that.
You might also want to change the way you're retrieving entity B in dataview Y. Keep in mind that retrieving from a database does not catch memory changes.
As a last resort you could use the community commons refreshClass or refreshClassByObject and see if that helps.
Regards,
Ronald