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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
SuperCal99
Helper I
Helper I

Calculate % difference between two years

I would like to work out % difference between 2 years for a set of values and having some trouble doing so.

 

First of all, let’s say I have the following sample of data

 

YearFruitName

2020

AppleJohn
2019AppleMary
2020BananaPaul
2020OrangeJohn
2019AppleMary
2019BananaJohn
2020LemonPaul
2019ApplePaul


In a visual, I want to create the following Matrix.

 

 Apple  Banana  
Name20192020% change20192020% change
John23%19%-4%22%16%-6%
Paul22%19%-3%13%21%8%
Mary24%22%-2%12%26%14%

 

The year % is easy, im just struggling to correctly work out the values in the  % change for each person using a measure

Any assistance would be greatly appreciated

 

Regards,

Cal

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SuperCal99 , You need create a separate year table(say Date) and the create a measure like

 

example

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

 

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @SuperCal99 ,

You can refer to the following link to try out grouping in a custom matrix:

 https://community.powerbi.com/t5/Desktop/Matrix-column-header-label-custom-group/td-p/1253196

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@SuperCal99 , You need create a separate year table(say Date) and the create a measure like

 

example

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

 

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

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

Thanks @amitchandak - appreciate that

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.