Forum Discussion
TallGuy
1 year agoNew Member
Week over Week comparisons in two different graphs.
Hi everyone, Newbie here and I have a question about over time reporting. I have two tables and want to do a week over week comparison, but in two different graph sets for a total of 4 graphs. ...
hnguy71
1 year agoSuper User
hey TallGuy ,
Seems like an easy and straightforward request. I am assuming you're counting the number of interactions for each of your tables. so a basic measure using the DATE function like this would work:
Previous Week =
-- Find date in context, if none is selected, default to last date in source
VAR _SelectedDate = SELECTEDVALUE('DATE'[Date], MAX('DATE'[Date]) )
-- what's your threshold? could set this dynamically, but 7 days as a sample is okay
VAR _Threshold = 7
-- turn back time by 7 days
VAR _StartDate = DATE( YEAR(_SelectedDate), MONTH(_SelectedDate), DAY(_SelectedDate) - _Threshold)
VAR _EndDate = _SelectedDate - 1
RETURN
-- output
CALCULATE(COUNTROWS(Table_VM_Process), DATESBETWEEN('DATE'[Date], _StartDate, _EndDate), ALL('DATE'[Date]))