web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Compare Quarter This Year to Quarter Last Year

(0) ShareShare
ReportReport
Posted on by

Hello everyone,

So I had written a filter formula that filters data based on the result of a comparison between the number of the current quarter and that of last quarter. This no longer works because the current quarter is in a different year from last quarter. I've tried to use 

RoundUp(Year(Today())*12+Month(Today()/3),0) = RoundUp(Year(ThisItem.Created)*12+Month(ThisItem.Created)/3,0) - 1, but it doesn't work.

This is an excerpt of my formula...

Switch(
 dpd_Reports_PeriodOptions.Selected.Value,
 "This Week",
 WeekNum(Created) = WeekNum(Today()),
 "Last Week",
 WeekNum(Created) = WeekNum(Today() - 7),
 "This Month",
 Year(Created)*12+Month(Created) = Year(Today())*12+Month(Today()),
 "Last Month",
 Year(Created)*12+Month(Created) = Year(Today())*12+Month(Today())-1,
 "This Quarter",
 RoundUp(
 Year(Created) * 12 + Month(Created/3),
 0
 ) = RoundUp(
 Year(Today()) * 12 + Month(Today()/3),
 0
 ),
 "Last Quarter",
 RoundUp(
 Year(Created / 3) * 12 + Month(Created / 3),
 0
 ) = RoundUp(
 Year(Today()) / 3 * 12 + Month(Today()) / 3,
 0
 ) - 1,
 "Specific Period",
 Created >= dpc_Reports_StartDate.SelectedDate && Created <= dpc_Reports_EndDate.SelectedDate + 1
 );

 How can I resolve this?

I have the same question (0)
  • Verified answer
    AdaEloka Profile Picture
    on at
    Re: Compare Quarter This Year to Quarter Last Year

    This is how I eventually solved it...

    Year(ThisItem.Created)*4 + RoundUp(Month(ThisItem.Created)/3,0) = Year(Today())*4 + RoundUp(Month(Today())/3,0)...for this quarter.

    Year(ThisItem.Created)*4 + RoundUp(Month(ThisItem.Created)/3,0) = Year(Today())*4 + RoundUp(Month(Today())/3,0) - 1...for last quarter.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 652 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 410 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 236

Last 30 days Overall leaderboard