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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kb177
Helper II
Helper II

last month vs current month difference

Hi

 

I'm trying to calculate same month previous year diffrence with same month current year   and  want to show that difference into a new column, But i dont want the total to show total of previous year, I just want to see only the total of difference like below

 

jan-21  10000  

feb 21 15000

mar-21 25000

jan 22- 12000    2000

feb-22  20000    5000

total                   7000

2 REPLIES 2
kb177
Helper II
Helper II

Hi

 

Will this effect total column as well along with row wise 

Anonymous
Not applicable

@kb177 

Please try

Previous Year Sales Difference = 

VAR previousYearSales = 
CALCULATE(
    SUM(Sheet1[Sales]),
    DATEADD(Sheet1[Dates],-1,YEAR)
)

Var currentYearSales = 

CALCULATE(
    SUM(Sheet1[Sales])
)

RETURN

if([Previous Year Sales] >0,currentYearSales-[Previous Year Sales],"")

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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