March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Community!
Having difficulties with calculation of amount in a quarter which is cumulative total for last 4 quarters. E.G. q4 2022 should show q1-q4 2022 sum,q3 2022 should show q4 2021 - q3 2022 and so on. What I've manged to do - create measure which actually calculates needed amount but it is "too dummy" and I need better solution.
<>___Last4QtrTotal =
CALCULATE( [amount], DATEADD(Period[Date],-3,QUARTER)) +
CALCULATE( [amount], DATEADD(Period[Date],-2,QUARTER)) +
CALCULATE( [amount], DATEADD(Period[Date],-1,QUARTER)) +
[amount]
Sample of data and needed output below:
year | quarter | amount | total for last 4 qtr |
2020 | q1 | 50 | 50 |
2020 | q2 | 60 | 110 |
2020 | q3 | 70 | 180 |
2020 | q4 | 80 | 260 |
2021 | q1 | 90 | 300 |
2021 | q2 | 100 | 340 |
2021 | q3 | 110 | 380 |
2021 | q4 | 120 | 420 |
2022 | q1 | 130 | 460 |
2022 | q2 | 140 | 500 |
2022 | q3 | 150 | 540 |
2022 | q4 | 160 | 580 |
Solved! Go to Solution.
@bsas , You can try a measure like
Rolling 4= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-4,QUARTER))
Rolling Months Formula: https://youtu.be/GS5O4G81fww
@bsas , You can try a measure like
Rolling 4= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-4,QUARTER))
Rolling Months Formula: https://youtu.be/GS5O4G81fww
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |