Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I have a table of registered sales # with dates on which the sales were made. And I have a calendar table attached to it. This way I get a chart with growth of sales per day. However I want to see comparison between periods. For that I made two more Calendar tables and then I calculate Sales with USERELATIONSHIP on either Current Calendar or Previous Calendar. Both Current and Previous Calendars have filter slicers so you can compare whatever period with whichever.
My goal is to have a chart with X axis of Current Calendar (Y for sales amount) and have both Current and Previous sales on the same timeline, by offseting the Previous Calendar MIN(date) to match Current Calendar's. That way if I select to measure 2019/03/01-2019/03/07 period with 2019/02/21-2019/02/27 I get different Sales lines on the same timeline. The idea is that Previous start date matches the date of current start. And if it is longer then the timeline extends, but Current Sales line ends before Previous Sales line.
The problem is that I do not know how to Calculate Previous Sales and after that Offset their Real Dates to those of Current Dates, keeping their real values.
Hi LukasUM,
According to your description, my understanding is that you want to display two value on the same X axis based on the data slicer, in this scenario, we can use the following steps:
Create two calendar table and create single relationship to the data table, and then create the following two measure:
Measure1 = CALCULATE(SUM(Data[Data]),FILTER(ALL(Data),Data[Date] >= MIN(calender1[Date]) && Data[Date] <= MAX(calender1[Date]))) Measure2 = CALCULATE(SUM(Data[Data]),FILTER(ALL(Data),Data[Date] >= MIN(calender2[Date]) && Data[Date] <= MAX(calender2[Date])))
The result will like below:
Best Regards,
Teige
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 99 | |
| 76 | |
| 56 | |
| 51 | |
| 46 |