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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
valeBonini7
New Member

How to calculate difference between years

Hi, I would like to have this pivot table where the "difference" is calculated as the difference between (value year)- (value prevoious year)

So like: value 2023-2022, 2022-2021, 2021-2020

How ca  I do?

 

valeBonini7_0-1724225536793.png 

 

(I also would like to order the table with descending years if possible)

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@valeBonini7 , Create a calculated column for the previous year's value:

PreviousYearValue =
CALCULATE(
SUM('YourTable'[Value]),
FILTER(
'YourTable',
'YourTable'[Year] = EARLIER('YourTable'[Year]) - 1
)
)

 

One more for difference

Difference = 'YourTable'[Value] - 'YourTable'[PreviousYearValue]




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@valeBonini7 , Create a calculated column for the previous year's value:

PreviousYearValue =
CALCULATE(
SUM('YourTable'[Value]),
FILTER(
'YourTable',
'YourTable'[Year] = EARLIER('YourTable'[Year]) - 1
)
)

 

One more for difference

Difference = 'YourTable'[Value] - 'YourTable'[PreviousYearValue]




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.