Forum Discussion
weekly data comparison from same period last year
Hi I am new to power bi, and I am meaning to compare weekly data from of 2019 and 2020 for the same period. I want to have something like this table into power bi, difference of total fund sales for the time period (8/24/2019 - 9/1/2019) to total fund sales for the time period (8/20/2020-8/30/2020) same goes for columns total guests and average sales.
| 8/24/19-9/1/19 | |||||
| 8/20/20-8/30/20 | |||||
| Total | Total | Ave | |||
| Fund Sales | Guests | Sale | |||
| xyz Coffee | 2019-2020 | 2000.2 | 432 | 4.630092593 | |
| xyz Coffee | 2020-2021 | 700.17 | 143 | 5.001188811 | |
| DIFFERENCE | -1300.03 | -289 | 0.989151774 | ||
| abc Hutt | 2019-2020 | 3000 | 541 | 5.545286506 | |
| abc Hutt | 2020-2021 | 1804.69 | 286 | 6.310104895 | |
| DIFFERENCE | -1195.31 | -255 | 0.105021716 |
1 Reply
- AllisonKennedy
Community Champion
Anonymous Do you have a DimDate table? If not, get one and add a WeekNumber column (or Start of Week or End of Week, or all three!) to it.
Use the Week column in a table/matrix visual along with [Total Fund Sales] where
Total Fund Sales = SUM(Table[FundSales])
Prev Year Total Fund Sales = CALCULATE( [Total Fund Sales], DATEADD(DimDate[Date], -12, Month) )
Do the same for each measure you want to display.
Diff = [Total Fund Sales] - [ Prev Year Total Fund Sales]