Motion data tag only for X, Y and Z

Solution 1:

In Minecraft 1.14 and later versions, this can be done using the /data modify command:

To set the X coordinate of an entity:

/data modify entity <entity> Motion[<coord>] set value <value>d

Use Motion[0] for the X coordinate, Motion[1] for the Y coordinate, and Motion[2] for the Z coordinate.