It seems powerBi doesn't have the functionality to compare data from different time periods and overlap the results into one single visual. However, I came across the following article which allowed me to almost accomplish my task : https://www.sqlbi.com/articles/filtering-and-comparing-different-time-periods-with-power-bi/ After applying the method in the article (except from the normalization factor), I dragged the following values into a table visual
- Date (of my sales table), Total_sales (measure), previous_sales(measure), %difference
There are currently two slicer filters (current and previous date range) applied on the table:
- 10/1/2018 to 10/2/2018 & 9/1/2018 to 9/2/2018
The table's output is as follows:
+-------------+----------------+----------------+-------------+
| date | total_sales | previous sales | %difference |
+-------------+----------------+----------------+-------------+
| sept 1 2018 | | 10,000 | -100.00% |
| sept 2 2018 | | 15,000 | -100.00% |
| oct 1 2018 | 20,000 | | N/A |
| oct 2 2018 | 30,000 | | N/A |
+-------------+----------------+----------------+-------------+
My two issues are: how to efficiently set it up so that the %difference can accurately calculate and how can I graph the lines so they can overlap into my line visual. When I try to graph it, it gives me a line for sept. 1-2 and a long empty space before oct. 1-2.
N.B: This whole exercise is inspired by the GA comparison date feature in their visuals.
Note: Please advise if you require my measure calculations (they aren't any different from the article and so are the relationships and Date tables)
total_sales
andprevious_sales
correspond to different time periods. Are you wanting theprevious_sales
to show up at a different date? Is that date always one month behind? – Alexis Olson