Forum Discussion
Trend Visualization compared to previous week
- 8 years ago
The myMax variable is essentially grabbing the current weeknum in the context of your visual. So, myMax - 1 essentially dials this back a week. So, if your current week is 16, when you are filtering for last week you want the rows where WeekNum is 15.
Hi Greg,
Sorry I read your post too late.
I was able to adjust the formula given above
Trend Truck =
VAR myMax = MAX('Date'[WeekNum])
VAR myCount = SUM('Table1'[Anzahl Trucks])
VAR tmpTable = FILTER(ALL('Date');[WeekNum]=myMax-1)
VAR lastWeekCount = COUNTX(tmpTable;[Anzahl Trucks])
RETURN myCount - lastWeekCount I think I understand what you did there but what does "myMax-1" do?
What Visual would you use to display a trend "this week compared to last week"?
Thanks for your help so far!
The myMax variable is essentially grabbing the current weeknum in the context of your visual. So, myMax - 1 essentially dials this back a week. So, if your current week is 16, when you are filtering for last week you want the rows where WeekNum is 15.
- TimonMeyer8 years agoFrequent Visitor
Thanks! I somehow managed to get the data right.
THX!
- Anonymous7 years agoNot applicable
Hi Timon,
Could you please share the way you do this visual? I'm new to Power BI and what I'm trying to do is to put two numbers in comparison on one single card and show the variance aside, which is just what you did.
Thank you!
Lexi
- Anonymous7 years agoNot applicable
Don't worry.
I just realised how to work it out by myself.
- corbusier8 years agoAdvocate IV
How would this work when last week is actually in last year?