Forum Discussion
Time series indexation
- 6 years ago
As long as the filter on mindate works i dont believe you need to combine the two, if theres more than 1 value per date in [Ptr %] i believe that all we need to do is change it to AVERAGE().
Measure = VAR minDate = [minDate] Return CALCULATE(AVERAGE(Table[Pct %]) ; ALL(Datatable) ; Datatable[Sales Month] = minDate)
Br,
J
Thank you very much for your input! With this method the selection of the min date works fine. However, selectedvalue is returning blank (I assume because there can be multiple values per month which need to be averaged first). But I don't have an idea how to combine average with selectedvalue. Do you have an idea on that?
As long as the filter on mindate works i dont believe you need to combine the two, if theres more than 1 value per date in [Ptr %] i believe that all we need to do is change it to AVERAGE().
Measure =
VAR minDate = [minDate]
Return
CALCULATE(AVERAGE(Table[Pct %]) ; ALL(Datatable) ; Datatable[Sales Month] = minDate)
Br,
J
- tsol016 years agoFrequent Visitor
I came to the same insight just a few minutes ago 🙂 thank you very much for your support! Saved my day!
I just changed it a bit and removed the ALL clause so the solution looks like this now:
Get the first date:
minDate = CALCULATE(min(Table[Sales date]), ALLSELECTED(Table[Sales date]))Calculate the index basis:indexValue = var minDate = [minDate] Return CALCULATE(AVERAGE(Table[Pct %]), Table[Sales date]=minDate)Indexate with the index basis:Pct indexed % = AVERAGE(Table[Pct %])/[indexValue] - tex6286 years ago
Community Champion
Happy to hear that! I hope it continues just as well 🙂
/ J