Forum Discussion
cong_nguyen_acc
6 years agoFrequent Visitor
Calculation price variance over time
Hi, I need help solving a calculation like this : + The table below shows the purchase price of an item from times to times. + A date mays have many prices , distincted by increased record_ID. ...
amitchandak
6 years agoSuper User
cong_nguyen_acc , You can get last date price like. Use date table
A new measure
Last Day Non Continous Price = CALCULATE(Avg('Table'[Price]),filter(all('Date'),'Date'[Date] =MAXX(FILTER(all('Date'),'Date'[Date]<max('Date'[Date])),Table['Date'])))
And take diff with price
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/