Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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]