The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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]
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
21 | |
14 | |
14 | |
9 | |
7 |