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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Using DAX to calculate difference on previous row

Hi All,

 

I have the following table and would like to translate progress on a project, to the actual percentage contributed per month. So essentially I would like to do a difference between row 3 and row 2 of the "Project A" column. I have been trying other solutions online using DAX but without success. The table below illustrates "Project A - Progress per month" which I wish to calculate with DAX.

 

Table1

Month:      Project A       Project A - Progress per month

Jul-20        0%                 (blank) 

Aug-20      8%                 8%

Sep-20       18%              10%

Oct-20       27%               9%

Nov-20      35%               8%

Dec-20      47%               12%

 

1 ACCEPTED SOLUTION

First add an Index column to your table using query editor, then add the calculated column for % contribution & use Lookupvalue function with IF. 

vikrantarora25_0-1597308007818.png

 

Table1[% Contribution] =
IF (
    Table1[Index] = 1,
    LOOKUPVALUE ( Table1[Project A], Table1[Index], Table1[Index] )
    LOOKUPVALUE ( Table1[Project A], Table1[Index], Table1[Index] )
        LOOKUPVALUE ( Table1[Project A], Table1[Index], Table1[Index] - 1 )
)

 

If this solves your query please mark this as a accepted solution.

 

Regards

View solution in original post

2 REPLIES 2

First add an Index column to your table using query editor, then add the calculated column for % contribution & use Lookupvalue function with IF. 

vikrantarora25_0-1597308007818.png

 

Table1[% Contribution] =
IF (
    Table1[Index] = 1,
    LOOKUPVALUE ( Table1[Project A], Table1[Index], Table1[Index] )
    LOOKUPVALUE ( Table1[Project A], Table1[Index], Table1[Index] )
        LOOKUPVALUE ( Table1[Project A], Table1[Index], Table1[Index] - 1 )
)

 

If this solves your query please mark this as a accepted solution.

 

Regards

Anonymous
Not applicable

Thank you, worked perfectly and gave the exact output I required.

 

Thanks!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.