Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Calculate Current Full Quarter SALES and Previous Full Quarter SALES in DAX

I am trying to calculate the equivalent of the below for Quarter data.  The below provides me the calculation for Month data.

I cannot reconfigure these measures to do the same for Quarter data.  I am wanting Current Full Qrt SALES and Previous Full QRT SALES.  I do have a column in Datetbl of:

QuarterStart = STARTOFQUARTER(DateTbl[Date])

Any help would be greatly appreciated.

tks/

 

Current Full month SALES =
CALCULATE ([GL Total],
FILTER (
ALL ('DateTbl'),
'DateTbl'[MonthStart]= DATE (YEAR ( TODAY ()), MONTH (TODAY () ) -1, 1 )))
 
Past Full month SALES =
CALCULATE ([GL Total],
FILTER (
ALL ('DateTbl'),
'DateTbl'[MonthStart]= DATE (YEAR ( TODAY ()), MONTH (TODAY () ) -2, 1 )))
1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Follow such patterns to extract current and previous quarter,

=
VAR __qtr = CALCULATETABLE(DATESQTD(DateTbl[Date]), ENDOFQUARTER(DateTbl[Date]))
RETURN
...
=
VAR __prev_qtr = CALCULATETABLE(DATESQTD(DateTbl[Date]), STARTOFQUARTER(DateTbl[Date])-1)
RETURN
...

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

4 REPLIES 4
CNENFRNL
Community Champion
Community Champion

Follow such patterns to extract current and previous quarter,

=
VAR __qtr = CALCULATETABLE(DATESQTD(DateTbl[Date]), ENDOFQUARTER(DateTbl[Date]))
RETURN
...
=
VAR __prev_qtr = CALCULATETABLE(DATESQTD(DateTbl[Date]), STARTOFQUARTER(DateTbl[Date])-1)
RETURN
...

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thanks so much!

Anonymous
Not applicable

Thanks, I have tried using that function and no luck.  Appreciate your post.

Jihwan_Kim
Super User
Super User

Hi,

I think, one of many ways to solve your problem is to use the below DAX function.

PARALLELPERIOD 

 

https://docs.microsoft.com/en-us/dax/parallelperiod-function-dax

 

 


 

    Microsoft MVP
 

 

   


      If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


   


     
        LinkedInVisit my LinkedIn page
     

   


   


     
        Outlook BookingSchedule a short Teams meeting to discuss your question

     

   


 


Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.