Forum Discussion
Anonymous
1 year agoNot applicable
Dynamic Percentage
Hello Everyone, I need to calculate the percentage change in price based on the selected date range in a slicer. For example, if I select the range from 2014 to 2016 for Code A, the percentage cha...
rajendraongole1
1 year agoSuper User
Hi Anonymous - Can you check below modified dax formulae to calculate the percentage change in price based on the selected date range in a slicer, with the percentage resetting to 0% at the start of the selected period
Measure =
VAR __firstnoblankdate = FIRSTNONBLANK(ALLSELECTED('Calendar'[Date]), BLANK())
VAR __base_value = CALCULATE(
SUM(Sheet1[Price]),
'Calendar'[Date] = __firstnoblankdate
)
VAR __cur_value = SUM(Sheet1[Price])
VAR __result = DIVIDE(__cur_value - __base_value, __base_value, 0)
RETURN
__result
Hope it works on reset part.