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
 
					
				
		
I have a data that provides values of sales for 2 years but on quarterly basis, Example:
| Year | Quarter | Sales | 
| 2020 | Q1 | 50 | 
| 2020 | Q2 | 30 | 
| 2020 | Q3 | 40 | 
| 2020 | Q4 | 50 | 
| 2021 | Q1 | 60 | 
| 2021 | Q2 | 70 | 
| 2021 | Q3 | 50 | 
| 2021 | Q4 | 40 | 
I need to calculate the sum of sales for the quarters previous to the chosen quarter (giving a slicer for the same) 
Till now I have used the following DAX, but am unsuccessful:
Solved! Go to Solution.
@Anonymous , With Time intelligence, create QTD and YTD and table a diff
example
QTD= CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
YTD= CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Till Last Qtr = [YTD] -[QTD]
@Anonymous , With Time intelligence, create QTD and YTD and table a diff
example
QTD= CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
YTD= CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Till Last Qtr = [YTD] -[QTD]
 
					
				
				
			
		
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 | 
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | 
| User | Count | 
|---|---|
| 23 | |
| 12 | |
| 11 | |
| 10 | |
| 9 |