1

I have 3 measures: A, B, C

Measure c is this calculation:

IF(A>B) 
  THEN A-B
ELSE 0

This formula run for every records, which works fine. The problem is that. I want to get sum of the measure c, the above formula work.

         A   B   C
         5   2   3
         6   8   0
total : 11  10   1

In above example the result that shown is "1" But I want to show "3"

What I want is this :

         A   B   C
         5   2   3
         6   8   0
total : 11  10   3

2 Answers2

0

Possibly the formula was running in the SUM too. See:

total : 11  10   1

11 is greater than 10, and 1 is 11-10;

Your formula are been applied

IF(A>B) 
  THEN A-B
ELSE 0

Try to make a query with different statement. Separating the conditions.

0

So not and ideal answer, as this measure will be tied to the hierarchy you want on ROWS.

Lets imagine you want the measure specifically when you use [Date] on rows.

SUM(
DESCENDANTS(
  [Date].[Calendar].CURRENTMEMBER, 
  [Date].[Calendar].[Date]
)
, IIF(
    [Measures].[A] > [Measures].[B]
    , [Measures].[A] - [Measures].[B]
    , NULL 
  )
)
whytheq
  • 34,466
  • 65
  • 172
  • 267