Forum Discussion
Need help creating date delta columns
- 11 years ago
you may also take a look at lookupvalue() function ...
Eg
01/01/15 manchester
02/01/15 Manchester
03/01/15 Manchester
01/01/15 London
02/01/15 London
Etc etc
Hope this is similar to what you need. Assuming you trying PowerBI Desktop.
First you need to create a Date table in order to have time intelligence measures. Go to the queries pane and select the query & right click - > duplicate or reference the query -> select the date column and remove all others -> remove duplicates in dates -> load.
Now you have 2 tables in data model -> create relantionship between the date columns .
Write the folowing measure ( only works in PBI Designer or excel 2016 preview else you need to create 3 measures - each for every variance) :
Delta :=
VAR totalvisits =SUM ( Table[Visits] )
VAR previousvisits =CALCULATE (SUM ( Table[Visits] );PREVIOUSDAY('calendar'[Date]))
RETURN DIVIDE ( totalvisits - previousvisits ; previousvisits )
Drag the date from the calendar table & and the store from your visits on the report..It should look like this