MacWilliams identity is one of the most important identities in coding theory. In this paper, we focus on MacWilliams identities for additive codes with a poset-block metric. Let R be a Galois ring and let \(k_1,\ldots ,k_n\) be positive integers. Let \(\mathcal {Z}=R^{k_1}\times \cdots \times R^{k_n}\) . Let \([n]=\{1,2,\ldots ,n\}\) , and let \(\mathbb {P}\) be a poset over [n]. We define a poset-block metric over \(\mathcal {Z}\) determined by \(\mathbb {P}\) , denoted by \(\mathbb {P}\) -B metric. Given an additive code \(\mathcal {C}\) in \(\mathcal {Z}\) equipped with the \(\mathbb {P}\) -B metric, we establish a necessary and sufficient condition for \(\mathcal {C}\) to satisfy MacWilliams identities. Two forms of MacWilliams identities are derived as well. We propose the Singleton bound for codes in \(\mathcal {Z}\) equipped with the \(\mathbb {P}\) -B metric and analyze the poset-block weight distributions of MDS linear codes. Finally, we obtain a generalization of MacWilliams identities for additive codes under the \(\mathbb {P}\) -B metric.