Forum Discussion
Week over Week comparisons in two different graphs.
2 Replies
- hnguy71Super 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])) - AnonymousNot applicable
Hi TallGuy ,
Please try this measure:
NewMeasure = CALCULATE([YourMeasure],DATEADD('Date'[Date],-7,DAY))It works by moving the time horizon of the measure forward by 7 days.
Also see this blog post on the measure [Sales PW]
Week-related calculations – DAX Patterns
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum