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! Learn more

Reply
Anonymous
Not applicable

Calculate (sum) the Previous year Quarter's value?

Hi Experts,

 

Can you please help me on the below issue.

 

I have the data and i have the year details in the slicer. I have the logic for calculating the current year's Q1 value.

 

C_Q1 = CALCULATE(SUM(TEST_REPORT[Amount in local cur.]),FILTER(TEST_REPORT,TEST_REPORT[QTR]=1),FILTER(TEST_REPORT,TEST_REPORT[CY YEAR]=TEST_REPORT[Year]))
 
I want to calculate the last year's Q1 values. I have the logic but it's not working.
 
I do not have the date info in my table. I have the period details only, so I have grouped that as Q1, Q2 etc.,
 
Can anyone help me on this, please? 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

I have found the solution, thanks Guys....

View solution in original post

7 REPLIES 7
Greg_Deckler
Community Champion
Community Champion

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Just remove the current filter on TEST_REPORT[CY Year] with the ALL function and set a new one to last year. In your logic, it should look like this:

 

C_Q1_LY =
CALCULATE(
                    SUM(TEST_REPORT[Amount in local cur.],

                    FILTER(

                               TEST_REPORT,

                               TEST_REPORT[QTR]=1
                               ),

                     FILTER(

                               ALL(TEST_REPORT[CY YEAR]);

                               TEST_REPORT[CY YEAR] = TEST_REPORT[YEAR] - 1

                               )
                     )

            

Anonymous
Not applicable

It's not working, I'm getting error..... 😞

 

Anonymous
Not applicable

Could you be a bit more specific? What error do you get?

Anonymous
Not applicable

I have found the solution, thanks Guys....

Hi @Anonymous ,

 

Can you share the solution? Thanks in advance.

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I just created the calendar table with DateKey and created the relationship with the main table.

 

Then i have created the Messure for the results.

 

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.

Top Solution Authors