Forum Discussion
Need help creating date delta columns
- 11 years ago
you may also take a look at lookupvalue() function ...
Hope you find a solution with lookupvalue() as andre suggested.
Regarding my solution, it won't work without having all dates in Date table..and the dates for visits are weekly ( my formula checks the previous day)
From your first post you can actually do it in DAX or PowerQuery.
1. My solution: "Add Index Column" in the reference query date you created load it and replace the delta measure second VAR with :
VAR previousvisits =CALCULATE (SUM ( Sheet1[Visits] );FILTER (ALL ( 'calendar' );'calendar'[Index]= MAX ( calendar'[Index] ) - 1))
If that not works check the links below..
For formatting DAX formulas (easier to look & understand) http://www.daxformatter.com/
2.A date dimention table will always be useful so - for creating a Date table take a look at this http://www.excelguru.ca/blog/2015/06/24/create-a-dynamic-calendar-table/
3.You can create the delta in PowerQuery by modifying a bit (change some functions) this post http://www.powerquery.training/portfolio/time-intelligence-with-power-query/
4.Else if you need to do it in DAX, you will need a Date or Custom Date table. There is a really great article & site http://www.daxpatterns.com/time-patterns/
Hope that helps...
Thanks Konstantinos. I will research your steps and pointers!