6 Replies Latest reply on Jun 14, 2017 1:36 PM by Mitch Haus

# can I set a condition on multiple measure Values in one calculated field?

I will give an analogy of the way my data is set up. Usually data has a date dimension and a revenue pill in the measures. these  will show us the revenues for those date.

My data is set up where there is no date column. I have multiple columns. one column for January Revenue, February Revenue, etc.. Is there a way to put a condition on the revenues stating that if jan and february revenue > x then "High" else "low"

• ###### 1. Re: can I set a condition on multiple measure Values in one calculated field?

Hi Andy

Yes - assuming the revenue is in the month columns - this is no different than writing a calc for any 2 other measures -   if Sum([January]) + sum(February) >x then 'High' else 'Low'

end

Let me know if this helps

Jim

• ###### 2. Re: can I set a condition on multiple measure Values in one calculated field?

so the way the pills are set up. The revenue pills are in the measures section. so Jan Rev, Feb Rev etc. how can I set a universal condition on revenue regardless or what month it is in?

I've attached a sample workbook.

• ###### 3. Re: can I set a condition on multiple measure Values in one calculated field?

Hi

Gee that's not the question you asked

The answer is that they are separate measures and need to be treated separately - you can try using Measured Values as rows in your viz and they setting a filter on it - probably using a parameter to set the limiting value then creating a t/f filter based on Measured Values and the Parameter

Let me know if that helps

Jim

• ###### 4. Re: can I set a condition on multiple measure Values in one calculated field?

So you want to build the same logic for 'high' or 'low revenues for any chosen month? Are you planning to label high or low per two-month revenue growth or per month at once?

• ###### 5. Re: can I set a condition on multiple measure Values in one calculated field?

per month

• ###### 6. Re: can I set a condition on multiple measure Values in one calculated field?

They need to be handled separately, but I would use a parameter ( [Threshold] )and just create a calculated field for each, like for [Jan Rev]:

IF SUM( [Jan Rev] >= [Threshold]

THEN "High"

ELSE "Low"

END

Do this for each month and then drag this string field onto the marks card.

Alternatively, if you just care about visualizing, you can drag the [Measure Values] field from the Measures pane onto the Color card under marks and then go to Advanced and select a middle point as your threshold and choose a 2 step diverging color scheme and then set your Marks type to square (see example) 