Level calc difficulty

I am unable to perform this calc mentioned below.

ifelse(
cost_center_id =‘1234’,
sum(L5,[domain])/sum({total for level mix},[domain]),
sum(L5,[{profile_name}])/sum({total for level mix},[{profile_name}])
)

Basically i have a pivot table. with
three columns - Group, profile name and domain.
and i want to the above columns to calculate values -
a) if Cost center is 1234 it should calculate by grouping domain
b) else it should group by profile name

it is giving mismatches aggregation error. can anyone help me on this calc or show me if there is another way to do it ?

Hi @karvsha,
Here’s a great article that explores level aware calculations that can help alleviate mismatched aggregation errors:

You may want to look in to utilizing the sumOver function instead.

Let us know if you have any additional questions

Hi @karvsha,
Following up here as it’s been awhile since we last heard from you; did you have any additional questions regarding your initial post or were you able to find a work around?

If we do not hear back within the next 3 business days, I’ll close out this topic.

Thank you!

Hey , can close for now. I will the solution posted above if that helps.