Forum Discussion
Measure is calculated incorrectly in a table
- 5 years ago
dashbuilder , I created three versions of it, Please check those out in the file attached after signature
dashbuilder , Create a separate date table and then try same formula with date table
example -
Percent Change =
var _max = maxx('DATE','DATE'[Date])
var _min = MINX('DATE','DATE'[Date])
return
(CALCULATE(AVERAGE(Table[Price]), FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_max))
-CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min)))/
CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min))*100
Also, use the divide function
- dashbuilder5 years agoNew Member
amitchandak thank you for your response. I have created a new data table as follows
Then, I altered the formula as suggested:
Percent Growth = var _max = maxx('DATE','DATE'[Date]) var _min = MINX('DATE','DATE'[Date]) return DIVIDE((CALCULATE(AVERAGE(Table[Price]), FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_max)) -CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min))), CALCULATE(AVERAGE(Table[Price]),FILTER(ALLSELECTED('DATE'),'DATE'[Date]=_min)))*100Now, I get "0"s:
Am I doing something wrong? Thank you heaps.
- amitchandak5 years ago
Super User
dashbuilder , I created three versions of it, Please check those out in the file attached after signature
- dashbuilder5 years agoNew Member
Awesome, thank you heaps amitchandak