Forum Discussion
Custom Quarters -Previous Quarter
Hi, I have a date table with my own Fiscal year and Qtr etc column in it.
I have my fiscal YTD measure working correctly and my
QTD measure working correctly
7 Replies
- amitchandak
Super User
Please use all(calendar[Date]) or all(calendar) for previous qtr.
If you need last year same QTR best choice it get Qtr No, Keep it same and subract year and use it
Measure =
Var _max_qtrNo = maxx(calendar,max(calendar[qtrno])
Var _max_Year = maxx(calendar,max(calendar[Year]) -1
last QTD_Budget = CALCULATE([BUDGETQTY],all(calendar),FILTER('CALENDAR',calendar[qtrno]=_max_qtrNo && calendar[Year] =_max_Year )
For last qtr chance these calculations
Var _max_qtr = maxx(calendar,max(calendar[qtrno])
Var _max_Yr = maxx(calendar,max(calendar[Year])
var _max_qtrNo =if(_max_qtr =1, 4, _max_qtr -1)
var _max_Year =if(_max_qtr =1, _max_Yr -1, __max_Yr )
last QTD_Budget = CALCULATE([BUDGETQTY],all(calendar),FILTER('CALENDAR',calendar[qtrno]=_max_qtrNo && calendar[Year] =_max_Year )
Also refer my blog
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners/ba-p/890814
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601- AnonymousNot applicable
Last year is not an issue as im using same period last year, its just last quarter,
The above suggestions didnt help me unfortunately still getting no values.
wondering whether to make a Quarter Sales Table for ease- amitchandak
Super User
If possible please share a sample pbix file after removing sensitive information.Thanks.
My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
- AnonymousNot applicable
Hi Anonymous ,
Please refer to the formula below and try using PREVIOUSYEAR() function.
Currentyear = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('CALENDAR'),'CALENDAR'[Qtr]<=MAX('CALENDAR'[Qtr])&&'CALENDAR'[year]=MAX('CALENDAR'[year]))) PREVIOUSYEAR = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('CALENDAR'),'CALENDAR'[Qtr]<=MAX('CALENDAR'[Qtr])),PREVIOUSYEAR('CALENDAR'[Date]))Result would be shown as below. Let me know if i misunderstood your meaning.
Pbix as attached.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Yes my previous year works fine its previous Quarter that doesnt.
Calendar year is Spt-Aug.
All helpgratefully received.
Thx Laura