Date dimension/formula problem

Jones01 Contributor
edited September 2022 in Charting


I'm not sure what I am trying is possible but here goes.

I have my data stacked as per @GrantSmith's excellent post.

What I need is a calculated column for the last year column that only includes the value if "Another Value" from the This year row = 'Y'

So only show 600 if another value =Y from period type this year

So I have

sum(case when `Period Type` = 'Last year' then `value` end)

Can this be extended to do what I need?

I have tried a few things such as below

case when sum(case when `Period Type` = 'This year' AND `Another Value` = 'Y' then 1 end) = 1 then sum(case when `Period Type` = 'Last year' then `value` end) end

but this won't work...

Any help would be appreciated.