Forum Discussion
Calculate Growth Based on Previous Row Calculation
- 2 years ago
Hi,
PowerBI file attached.
Hope this helps.
Hi John_W - create the forecast calculated column as below:
replace with your table name
Calculated column:
Forecast =
VAR CurrentHourPart = TableName[Hour_Part]
VAR CurrentTotal = TableName[Total]
VAR CurrentGrowth = TableName[Growth]
VAR PreviousHourPart = MAXX(FILTER(TableName, TableName[Hour_Part] = CurrentHourPart - 1), TableName[Forecast])
RETURN
IF(
NOT(ISBLANK(CurrentTotal)),
CurrentTotal,
PreviousHourPart * (1 + CurrentGrowth / 100)
)
Ensure that your Hour part column has no gaps
Hope it works, still issue exist share the data in drive, will check it.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
- John_W2 years agoFrequent Visitor
Thanks for looking at it. Unfortunately, this doesn't work.
Total and Growth are measures so creating a calculated column is not going to work for me. (Unless I'm doing something wrong was a probably the case).
I'll work on getting a sample pbix file uploaded.