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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
csanromano
Regular Visitor

Calculate difference between two rows

Hi. I am a beginner in Power BI; I do not know if this is the right forum.

I have the following table:

Year / Week / Value

2015 / 27 / 1000

2015 / 28 / 1010

2016 / 27 / 1200

2016 / 28 / 1205

I need to plot the value growth for each week YoY, ie 1200/1000 = 120% for the week 27 (YoY) and 1205/1010 = 119.3% for the week 28 (YoY)

I tried to do this by creating a column and a measure, but can not find the way.

The year and week, are values and no dates.

Some help?

1 REPLY 1
Anonymous
Not applicable

Hi, I just worked on your problem.. If this is column of two years then the below calculation will work:

 

DIVIDE(CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year]))),(CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])-1))))
 
I build this formula in two sections
Numerator: 
CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])))
Denominator:
CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])-1))
then did the divide.
Below are the results:: Let me know if it works for you 🙂
 
Capture.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.