Difference percentage between current row and previous row (as a measure)

  • Type: Inserted as a measure
  • Description: Calculates the difference, as a percentage, between two values, current row and previous row.
  • Range:
    • Columns: Each column
    • Rows: Current row minus Previous row
    • Measures: First measure
  • Syntax:
if sum(0, -1, m1, 0) <= 0 then 0 else (sum(0, 0, m1) - sum(0, -1, m1)) / sum(0, -1, m1)
  • Sample crosstab:

 

Example

Here we want to calculate the percent difference between current row and previous row (months) for each column.

Notice that the first row sums to 0, since there is no previous row.

Also notice the behavior of this calculation when dealing with gaps in data and negative numbers.

When you go from a positive number to nothing - it's considered a 100% drop (see below).

Also, growth from a negative number is not calculated as a percentage.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.