Forum Discussion
Alicetemitope
3 years agoFrequent Visitor
Forecasting using previous day value
Hi Team, I hope you all are doing great. I am a newbie to DAX and PBI annd currenntly working on a task to predict cost. I had to calculate the slope(which I did using the Linest function) and add th...
- 3 years ago
Alicetemitope No, but you could do this potentially:
Measure = VAR __Date = MAX('Table'[Date]) VAR __Table = ADDCOLUMNS( DISTINCT(ALLSELECTED('Table'[Date])), "__DailyCost",[Amortized Cost(E) ) VAR __MaxDate = MAXX(FILTER(__Table, [__DailyCost] <> BLANK()), [Date]) VAR __Value = MAXX(FILTER(__Table, [Date] = __MaxDate), [__DailyCost]) VAR __Result = __Value * [Slope] RETURN __Result
Greg_Deckler
3 years agoCommunity Champion
Alicetemitope No, but you could do this potentially:
Measure =
VAR __Date = MAX('Table'[Date])
VAR __Table =
ADDCOLUMNS(
DISTINCT(ALLSELECTED('Table'[Date])),
"__DailyCost",[Amortized Cost(E)
)
VAR __MaxDate = MAXX(FILTER(__Table, [__DailyCost] <> BLANK()), [Date])
VAR __Value = MAXX(FILTER(__Table, [Date] = __MaxDate), [__DailyCost])
VAR __Result = __Value * [Slope]
RETURN
__Result
- Alicetemitope3 years agoFrequent Visitor
Greg_Deckler thank you so much for your help. Your suggestion helped in fine tuning my calculations. In the end, we stopped this approach and decided to use OLS for the predictions. which was much easier and made more sense.