Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to create a formula which selects the expression based on whether a field has been selected or not.
The aim is to show previous YTD (e.g. sum({<_YTD_PY={1}>} [Total Discount])), however when a user selects another year, the formula would instead show sum([Total Discount]).
Currently I have:
IF(
GetSelectedCount(Year)=0,
sum({<_YTD_TY={1}>} [Total Discount]),
sum([Total Discount])
)
This formula works if no year is selected, however if a year is selected it will only show 0.
Any help would be much appreciated.
Thank you in advance.
Hi
try this
if (aggr(sum(1),year)>0, sum({<_YTD_TY={1}>} [Total Discount]), sum([Total Discount]))
Why do you think that the expression will show 0 when you have the year is selected? I think it should show the Sum for the particular year selected? Have you tried it out yet?