
Re: Calculated measures
omar bensalem Apr 7, 2017 9:47 AM (in response to Mike Slottje)Based on your example data :
if(sum({<Category={'A'}>}[Revenue 2014])>0 and sum({<Category={'A'}>}[Revenue 2015])>0 and sum({<Category={'A'}>}[Revenue 2016])>0,
(sum({<Category={'A'}>}[Revenue 2014])+sum({<Category={'A'}>}[Revenue 2015])+sum({<Category={'A'}>}[Revenue 2016]))/3
,
if(sum({<Category={'A'}>}[Revenue 2014])<0 and sum({<Category={'A'}>}[Revenue 2015])>0 and sum({<Category={'A'}>}[Revenue 2016])>0,
sum({<Category={'A'}>}[Revenue 2016])*1.2,
if(sum({<Category={'A'}>}[Revenue 2016])<=0 ,0,
if(sum({<Category={'A'}>}[Revenue 2015])<=0 and sum({<Category={'A'}>}[Revenue 2016])>0,
(sum({<Category={'A'}>}[Revenue 2014])+sum({<Category={'A'}>}[Revenue 2016]))/2
)
)
)
)

Re: Calculated measures
omar bensalem Apr 7, 2017 10:19 AM (in response to omar bensalem )If your question has been answered, please don't forget to close the thread by marking the correct answer as so.
Thanks,

Re: Calculated measures
Mike Slottje Apr 7, 2017 10:23 AM (in response to omar bensalem )Thanks for your reply Omar! I was still testing haha. I will mark the correct answer if I have everything working!:)
Unfortunately, I'm still getting NULL values when I'm using the next part of your code.
(if(sum({<Category={'A'}>}[Revenue 2014])<0
and sum({<Category={'A'}>}[Revenue 2015])>0
and sum({<Category={'A'}>}[Revenue 2016])>0,
sum({<Category={'A'}>}[Revenue 2016])*1.2)
And what should I do if I want to add the same formulas for Category B to this formula, but with category B * 1.1?

Re: Calculated measures
omar bensalem Apr 7, 2017 10:43 AM (in response to Mike Slottje)Can you share the qvf file (your app) you're working with?

Re: Calculated measures
Mike Slottje Apr 7, 2017 10:46 AM (in response to omar bensalem )I can't do that unfortunately, because the data that we use is confidential for our company..
What I'm searching for, is a formula that says what you already explained, but with a second if statement (if category = B). That could be the same formula, but I can't get the multiple if statements working.
Sorry for the inconvenience..

Re: Calculated measures
omar bensalem Apr 7, 2017 11:01 AM (in response to Mike Slottje)You simply choose a chart,
as dimension: category:
as measure:
if(sum([Revenue 2014])>0 and sum([Revenue 2015])>0 and sum([Revenue 2016])>0,
(sum([Revenue 2014])+sum([Revenue 2015])+sum([Revenue 2016]))/3
,
if(sum([Revenue 2014])<0 and sum([Revenue 2015])>0 and sum([Revenue 2016])>0,
sum([Revenue 2016])*1.2,
if(sum([Revenue 2016])<=0 ,0,
if(sum([Revenue 2015])<=0 and sum([Revenue 2016])>0,
(sum([Revenue 2014])+sum([Revenue 2016]))/2
)
)
)
)
result :
I'm working with :



