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
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
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.