12 Replies Latest reply: Feb 26, 2018 8:07 AM by Baarathi V

# Set Expression

Hi I have attached a file in which i need to calculate the percentage for Revenue % = (sum(Amount) - sum(Adjustment)) / Total (sum(Amount) - sum(Adjustment))  for particular month-year.

• ###### Re: Set Expression

It should be :

• ###### Re: Set Expression

Sir, But I am getting error in set modifier expression while using this

• ###### Re: Set Expression

Is this correct?

the measure is :

=(Sum(Amount) - Sum(Adjustment)) / (Sum(total {<"Year", "Month">} Amount) - Sum(total {<"Year", "Month">} Adjustment))

even , when u select a Year, the percentage doesn't become 100%:

But would return each % based on the selection of the Type:

Now if u want to it to be based on the Type from the start :

u change the expression as follow:

result:

see the attached app:

• ###### Re: Set Expression

I fail to understand why you need set analysis here?
Use the keyword "All" before sum(amount) in denominator if you don't want denominator to change.

Like

• ###### Re: Set Expression

ALL is NOT the right way to do it, u should be using Total {<YourDimension(used in the chart)>}

to be able to track the real percentages if u make a selection on other dimensions

• ###### Re: Set Expression

omarbensalem sir I want pivot chart output similar to Desired Output.xls, where as I am getting output similar to Undesired Output.xls

• ###### Re: Set Expression

But u don't have values in both low and hight for each year:

• ###### Re: Set Expression

Ya In the sample Data Which I have sent there is no data for Top and Low in same month-year. But there are cases where i have both top and low in same month-year.

• ###### Re: Set Expression

Try this:

as column: Year

as Line: PType

as measure