Forum Discussion
Show Week-over-Week % increase in Matrix visual?
Hi there
What I would suggest doing is to put all your measures into one measure and then debug them using the variables. You can watch this video by Adam and Marco who explain how to do the debugging.
https://www.youtube.com/watch?v=9SV2VnYbgg4
I would also suggest creating a Date table, as this makes Time Intelligence measures work.
You can find details on how to create it from my blog post here: https://www.fourmoo.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fiscal-attributes-using-power-query/
Then below is the measure that I created on my Google Analytics and it works as expected.
% Weekly Change =
VAR ThisWeekDate =
WEEKNUM ( TODAY (), 2 )
VAR LastWeekDate =
WEEKNUM ( TODAY (), 2 ) - 1
VAR ThisYear =
YEAR ( TODAY () )
VAR CurrWeekUsers =
CALCULATE (
[Users],
FILTER (
'Date',
'Date'[Week Number of Year] = ThisWeekDate
&& 'Date'[Calendar Year] = ThisYear
)
)
VAR PrevWeekUsers =
CALCULATE (
[Users],
FILTER (
'Date',
'Date'[Week Number of Year] = LastWeekDate
&& 'Date'[Calendar Year] = ThisYear
)
)
VAR PercChange =
DIVIDE ( ( CurrWeekUsers - PrevWeekUsers ), PrevWeekUsers )
RETURN
PercChange
Thank you Gilbert, could you show an example of a chart or matrix visual using this measure? How does it look? For example, in mine, I'd like to display the last 4 weeks but only show the % change once, for the last 2 weeks.
- GilbertQ8 years agoSuper UserHi there
Could you please explain how you would want to display the last 4 weeks but only show the % change for the last 2 weeks?
Would this all be on one matrix?