Forum Discussion
e175429
Helper IV
1 year agoCalculating % 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...
- 1 year ago
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 vResultFor future reference, you can copy your data and paste using the Table icon rather than a screenshot.
DataInsights
Super User
1 year ago
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.
- e1754291 year ago
Helper IV
Thank you very much