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! Learn more
Hi all,
I'm trying to compare volume of requests across two years and chart in on a line graph. Eg. line graph comparing Mar16-Mar17 on one line and Mar15-Mar16 on the secondary line. Any idea how I can do this?
Thanks,
Mike
Solved! Go to Solution.
Hi @mshamsiev,
I'm trying to compare volume of requests across two years and chart in on a line graph. Eg. line graph comparing Mar16-Mar17 on one line and Mar15-Mar16 on the secondary line. Any idea how I can do this?
If I understand you correctly, you should be able to make use of SAMEPERIODLASTYEAR Function (DAX) to create a new measure to do your calculations for the same period last year, which should be easier in your scenario. 
For example, if you want to compare the total sales of Mar16-Mar17 and Mar15-Mar16, then you can show both [Total Sales] and [PY Sales] as the Values for the Line Chart, and use a Slicer to filter the date to Mar16-Mar17.
Total Sales = SUM(Sales[Revenue])
LY Sales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Date'[Date]))
Regards
Hi @mshamsiev,
I'm trying to compare volume of requests across two years and chart in on a line graph. Eg. line graph comparing Mar16-Mar17 on one line and Mar15-Mar16 on the secondary line. Any idea how I can do this?
If I understand you correctly, you should be able to make use of SAMEPERIODLASTYEAR Function (DAX) to create a new measure to do your calculations for the same period last year, which should be easier in your scenario. 
For example, if you want to compare the total sales of Mar16-Mar17 and Mar15-Mar16, then you can show both [Total Sales] and [PY Sales] as the Values for the Line Chart, and use a Slicer to filter the date to Mar16-Mar17.
Total Sales = SUM(Sales[Revenue])
LY Sales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Date'[Date]))
Regards
Bump
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 84 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |