Forum Discussion
Elofly
3 years agoFrequent Visitor
Last Week Daily Sales Line Graph
Hi everyone!
I am trying to build a line graph where I have the following data:
- Y axe: Total Sales
- X axe: Days of the week (Monday, tuesday, etc.)
- Line A: Last week sales
- Line B: Previous last week sales
I was able to manage almost everything but I cannot seem to get both values in the same graph.
Can you help?
Thanks a lot!
Hi Freeman,
At the end I went for this:
Last Week TTV (-2) =var LASTWEEK = WEEKNUM(TODAY()-7,2)returnCALCULATE(SUM(vw_Becca_ZoeBookings[TotalPrice]),FILTER('Calendar Bookings','Calendar Bookings'[Week Number] = LASTWEEK))Thanks a lot for your help!Best regards,
7 Replies
- FreemanZSuper UserThat involves time intelligence functions. If you have a Date table, then it is easy.Supposing you have a measure for the current Total Sales name [Total Sales], then you can create two new measures with the code below:Last Week Total Sales := CALCULATE ([Total Sales], DATEADD('Date'[Date], -7, DAY) )Previous Last Week Total Sales := CALCULATE ([Total Sales], DATEADD('Date'[Date], -14, DAY) )Plot all three measures in the same chart, then you see what you expect.Please come back, if you don't have a Date table.