Hello Experts,
I have the requirement to calculate the number of deputyships for the Entity Dimension as shown below in the screenshot.

I have created data action as the below to derive the count but that not working as expected its only working on the lowest leaf member while the deputyship entities are at the second level.

Any suggestion on how I can achieve that requirement?
Thanks.