Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I have a simple formula that sum sales for the max year (selected) and its previous one. The thing is that I have an 'if' condition before this formula as follows:
if( DimensionX='ABCD',
sum({$<[Year]={$(=Max(Year)),$(=Max(Year)-1)},[Type]={'yyy'}>}[Sales]).
Without the 'If' condition part, the formula works perfectly and when I select a year, it appears the sales for the year and previous year, but when I add the 'If' condition, if I select a year, the previous year doesn't appear and I need both years to appear.
Any advice??
Thanks in advance
Can you check now
Try this
If(Only({1} DimensionX) = 'ABCD', Sum({$<[Year]={$(=Max(Year)),$(=Max(Year)-1)},[Type]={'yyy'}>}[Sales]))
I tried it before but its not working, when selecting a year the previous year doesnt appear.
Would you be able to share a sample where this doesn't work?
Hello Sunny,
Here u have , it is a simple sample of my problem, so if you have any doubt I will try to add more info,
Thanks in advance
Can you check now
Hello Sunny,
I had to modify a little bit your expression because I need an If condition for each expression ( each expression is different for each dimension) as follows:
if(Only(TOTAL <Dimension>{1}Dimension)='X', ...
If(Only(TOTAL <Dimension>{1}Dimension)='Y', ...
If(Only(TOTAL <Dimension>{1}Dimension)='Z', ...)))
and now it works!
Many thanks!