This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I want to filter the current years quarter in a calculation.
Currently I am using two filters like this:
A02 = CALCULATE(A01, FILTER(PT, [PTDate].[Year]=YEAR([ActualDate])), FILTER( PT, [PTDate].[QuarterNo]=QUARTER([ActualDate] )))
Is there a better way to catch the year and quarter reference at once?
Solved! Go to Solution.
@dp32 That looks reasonable to me. Quarters are a pain! 🙂
Hi @dp32 ,
You may change your code like below:
A02 =
CALCULATE (
[A01],
FILTER (
PT,
[PTDate].[Year] = YEAR ( [ActualDate] )
&& [PTDate].[QuarterNo] = QUARTER ( [ActualDate] )
)
)
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@dp32 That looks reasonable to me. Quarters are a pain! 🙂
Thank you both.
Time logic will not work, so I will stay with the current version.
Quarters are indeed a pain, but not the only one :-).
@dp32 , if you can use time intelligence that would be best . With a date table
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))
another way is qtr rank/ with Qtr/date table
Qtr Rank = RANKX(all('Date'),'Date'[Qtr Start date],,ASC,Dense)
This Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])))
Last Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])-1))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...
Appreciate your Kudos.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 25 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 36 | |
| 32 | |
| 25 | |
| 23 |