
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Previous Quarter calculation
Hi everyone!
I'm trying to calculate the change in two quarters, I think I'm getting close but not sure what else I am missing in my formula and hoping that someone can help. Basically, user will select a quarter and the KPI will show current value and what the change was from prior quarter.
Here are the sales figures:
Current Quarter Sales: 356
Previous Quarter Sales: 524
I created two variables to return the start dates, one for current quarter and another for previous quarter:
vCurrentQuarter: date(min([Year Month]),'YYYY-MMM')
vPreviousQuarter: date(addmonths(min([Year Month]),-3),'YYYY-MMM')
Calculation for Previous quarter sales: sum(${<'$(vCurrentQuarter)' ={"$(vPreviousQuarter)"}>} Sales)
The calculation keeps giving me current quarter sales. What am I missing? Thanks in advance!
- « Previous Replies
-
- 1
- 2
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@snancyiv Once you have a well-formatted date field, try these
Current: Sum({<[Date Field]={">=$(=Quarterstart(today(1)))<=$(=Quarterend(today(1)))"}>}Sales)
Previous: Sum({<[Date Field]={">=$(=Quarterstart(today(1),-1))<=$(=Quarterend(today(1),-1))"}>}Sales)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @BrunPierre ,
I'm still getting current quarter values. For more reference, the filter to to select quarters is based on the quarter start date, "QuarterStart" which is calculated field in the script as Quarterstart(Date).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Provide some samples of the data.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Removed sensitive info from the original. Please filter "YearQuarter" on 2022-Q4 when you open it to see my example.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The association is on Date to Discharge Date. When you filter on 2022-Q4, it should be:
Current Quarter TotalNumerCase: 107
Previous Quarter TotalNumerCase: 162

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe this
Current Quarter: Sum({<DischargeDate={">=$(=QuarterStart(Max(DischargeDate),-1))<=$(=AddMonths(Max(DischargeDate),-3))"}>}TotalNumerCase)
Previous Quarter:Sum({<DischargeDate={">=$(=QuarterStart(Max(DischargeDate)))<=$(=AddMonths(Max(DischargeDate),0))"}>}TotalNumerCase)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Current Quarter : sum({<[Date-DischargeDate]={">=$(=QuarterStart(Max([Date-DischargeDate]))) <=$(=QuarterEnd(max([Date-DischargeDate])))"}>}TotalNumerCase)
Previous Quarter : sum({<[Date-DischargeDate]={">=$(=QuarterStart(Max([Date-DischargeDate]),-1)) <=$(=QuarterEnd(max([Date-DischargeDate]),-1))"}>}TotalNumerCase)
Thanks,
Krishna

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I still get the same amount as current quarter for previous calculation. 😞

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still getting the same amount as current quarter

- « Previous Replies
-
- 1
- 2
- Next Replies »