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
JohnLow
Helper I
Helper I

Previous Year query

Hi all, 

 

I'm running into an issue when trying to calculate a budget for the previous year. I have 3 columns and I've created the following new column below, I just get blank values however. Could anyone please let me know where I'm going wrong. 

BudgetTotalPreviousYear = CALCULATE(SUM('Table'[Budget total]),PREVIOUSYEAR('Table'[YearPeriod]))

The data is attached here

 

JohnLow_0-1614857228413.png

Thank you for any help.

 

2 ACCEPTED SOLUTIONS
Tahreem24
Super User
Super User

@JohnLow  try to create any measures among these:

BudgetTotalPreviousYear MEASURE = CALCULATE(SUM('Table'[Budget total]),PREVIOUSYEAR('Table'[YearPeriod]))

Or try this:

BudgetTotalPreviousYear MEASURE= CALCULATE(SUM('Table'[Budget total]),DATEADD('Table'[YearPeriod],-1,YEAR))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

Anonymous
Not applicable

Hi @JohnLow,

Have you tried to directly use the date function to calculate the previous data for calculating?

BudgetTotalPreviousYear =
VAR curr = 'Table'[YearPeriod]
RETURN
    CALCULATE (
        SUM ( 'Table'[Budget total] ),
        FILTER (
            'Table',
            [YearPeriod]
                = DATE ( YEAR ( curr ) - 1, MONTH ( curr ), DAY ( curr ) )
        )
    )

Regards,
Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Tahreem24
Super User
Super User

@JohnLow  try to create any measures among these:

BudgetTotalPreviousYear MEASURE = CALCULATE(SUM('Table'[Budget total]),PREVIOUSYEAR('Table'[YearPeriod]))

Or try this:

BudgetTotalPreviousYear MEASURE= CALCULATE(SUM('Table'[Budget total]),DATEADD('Table'[YearPeriod],-1,YEAR))

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Thanks. I'm just wondering about the measure in a line chart now. It doesn't seem to work as expected. 

I've attached the file. Thanks again. 

File 

Anonymous
Not applicable

Hi @JohnLow,

Have you tried to directly use the date function to calculate the previous data for calculating?

BudgetTotalPreviousYear =
VAR curr = 'Table'[YearPeriod]
RETURN
    CALCULATE (
        SUM ( 'Table'[Budget total] ),
        FILTER (
            'Table',
            [YearPeriod]
                = DATE ( YEAR ( curr ) - 1, MONTH ( curr ), DAY ( curr ) )
        )
    )

Regards,
Xiaoxin Sheng

amitchandak
Super User
Super User

@JohnLow , This will work as measure not column. Also use date table

 

 

BudgetTotalPreviousYear = CALCULATE(SUM('Table'[Budget total]),PREVIOUSYEAR('Date'[DAte]))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

 

 

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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