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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculate if field = field-10

Hi there,

I am new to PowerBI and cannot make sense of the "CALCULATE" formula.

 

I am trying to calculate the salesvalues from a different fiscal quarter (fiscal quarter are not dates so all the dates related functions are not possible here).

 

the data looks like:

 

FQuarter  Amount

20201    $23,456

20202     $22,555

20203     $23,666

20204     $24,777

20211     $25,888

 

I am trying to do something like : CALCULATE(SUM(Amount), FQuarter=FQuarter-10).

I am probably using the wrong calculation here.

 

Has anyone got an idea please?

 

Thanks,

 

Alex

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Create a new table with FQuarter , year, and other required columns, say date.

 

Then create a rank on FQuarter 

 

a new column

Qtr Rank = RANKX(all('Date'),'Date'[FQuarter ],,ASC,Dense)

 

 

measure examples 
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))

 

10 qtr behind

Last Qtr = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])-10))

 

Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (1,176)