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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX - Amount for Quarter Last Year

Hello,

 

I will greatly appreciate your input on the following - 

 

I need to calculate the Sales Amount for the full quarter last year.  

 

I am trying the following but the result is too high

 

QTD Full LY = Calculate([Sales-Net-SPLY],
DATESBETWEEN('0-GBQ-Calendar'[greg_date],
STARTOFQUARTER('0-GBQ-Calendar'[greg_date]),
ENDOFQUARTER('0-GBQ-Calendar'[greg_date])
))
 
Sales-Net-SPLY is a measure for Sales last year.  
Is there Dax for Startofquarter last year and end of quarter last year?
 
Thanks,
 
Pavan
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try measure like

 

Last year full qtr =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max2 = date(Year(_max1) -1, month(_max1) , Day(_max1))
var _min = eomonth(_max2,-1* if( mod(Month(_max2),3) =0,3,mod(Month(_max2),3)))+1
var _max = eomonth(_min,2)
return
CALCULATE([net] ,Filter('Date','Date'[Date]>= _min && 'Date'[Date] <= _max))


or

Qtr =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1

 

 

refer if needed

 

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27304
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks Amit.

Looks really neat!

I will try it out.  

Thanks again!

amitchandak
Super User
Super User

@Anonymous , try measure like

 

Last year full qtr =
var _max1 = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _max2 = date(Year(_max1) -1, month(_max1) , Day(_max1))
var _min = eomonth(_max2,-1* if( mod(Month(_max2),3) =0,3,mod(Month(_max2),3)))+1
var _max = eomonth(_min,2)
return
CALCULATE([net] ,Filter('Date','Date'[Date]>= _min && 'Date'[Date] <= _max))


or

Qtr =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = eomonth(_max,-1* if( mod(Month(_max),3) =0,3,mod(Month(_max),3)))+1

 

 

refer if needed

 

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27304
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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