2 Replies Latest reply: Sep 23, 2017 5:04 AM by Amien Amien

# double formulas in alternative measure

I have this line chart:

dim : Year,Week (not as alternative)

in my measure i have this:

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-1)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Sales])

+

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-0)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Sales])

The result with be a line chart with two years. this works perfect because it's still 1 measure. Now i want to add an alternative measure:

(

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-1)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Sales])

/

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-1)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Visitors])

)

+

(

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-0)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Sales])

/

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-0)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Visitors])

)

Why this one doesn't work? Do i need to add something?

I can't create two separate expression for this, because i want to use alternative measures.

• ###### Re: double formulas in alternative measure

What is the data in Visitors field?

IF possible share sample data and expected output

• ###### Re: double formulas in alternative measure

Visitors also just contains values.

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-1)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Vistors])

+

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-0)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Vistors])

Works

But

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-1)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Vistors])

/

Sum({\$<[year]=,YearWeek=,MaxYear = {\$(=Max(MaxYear)-0)},MaxYearLabel = {"\$(=MaxYearLabel)"}>} [Sales])

Doesn't work