Forum Discussion
Anonymous
6 years agoNot applicable
How do you calculate the incremental change between rows?
How would you calaculate the difference between rows based on a certain criteria shared between the rows? In this case a Power Station's name, and then its increase in capacity over time. I would lik...
Anonymous
6 years agoNot applicable
Can I do it without making an index as the sort order will constantly be changing. Is there a way of looking up the plant name, on the previous date and taking it's capacity away from the plant with the most recent date?
Anonymous
6 years agoNot applicable
Anonymous -
For dynamic results, we need to use a DAX Measure.
Please see attached. The measure that calculates the difference is:
Capacity Change =
IF(
ISBLANK([Capacity On Date]),
BLANK(),
var _prev_date = LASTNONBLANK(
FILTER(
ALL('Date'[Date]),
'Date'[Date] < SELECTEDVALUE('Date'[Date])
),
[Capacity On Date]
)
return
[Capacity On Date] -
CALCULATE(
[Capacity On Date],
'Date'[Date] = _prev_date
)
)
I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
I also appreciate Kudos.
- Anonymous6 years agoNot applicable
Thanks for that. It is nearly there, but when you put the data in to a chart it shows the original capacity not the change in capacity
- Anonymous6 years agoNot applicable
Anonymous - Could you show the problematic chart? The example pbix appears to be working properly in a table visual:
- Anonymous6 years agoNot applicable