Forum Discussion

e175429's avatar
e175429
Icon for Helper IV rankHelper IV
1 year ago
Solved

Calculating % Change from Previous Year

Hello all,   This is my current table:   I would like to add a column that shows the % change from previous year for each section. Currently, I have no measures created.   This is my dat...
  • DataInsights's avatar
    1 year ago

    e175429,

     

    Try these measures:

     

    Total Served = SUM ( 'Table'[Total Served] )
    Percent Change from PY =
    VAR vCY =
        MAX ( 'Table'[Year] )
    VAR vCYAmount = [Total Served]
    VAR vPYAmount =
        CALCULATE ( [Total Served], 'Table'[Year] = vCY - 1 )
    VAR vResult =
        IF (
            HASONEVALUE ( 'Table'[Year] ),
            DIVIDE ( vCYAmount - vPYAmount, vPYAmount )
        )
    RETURN
        vResult

     

     

    For future reference, you can copy your data and paste using the Table icon rather than a screenshot.