We report on the magnetic structures in the TbNiAl 1−x In x compounds as determined by powder neutron diffraction. These compounds belong to a large family of ternary rare-earth intermetallics crystallizing in the ZrNiAl-type hexagonal structure. All studied compounds order magnetically with magnetic structures characterized by k 1 = (0,0,0) and k 2 = ( 1 2 ,0, 1 2 ) propagation vectors and magnetic moments aligned along or perpendicular to the hexagonal c axis. The magnetocrystalline anisotropy changes from uniaxial in the In-poor compounds (x 0.4) to planar in the In-rich compounds (x 0.5). The change of magnetocrystalline anisotropy type is a consequence of the development of structural parameters in the studied series. The Tb moments are oriented along the c axis when the nearest Tb-Tb distances between the planes are large compared to those within the planes, whereas Tb moments lie within the basal planes in the opposite case. This picture relating the structural parameters and anisotropy type can be generalized to the whole group of Tb-based compounds with the ZrNiAl type of structure.