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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
SundarKumar
Frequent Visitor

How to achieve Difference % based on previous row value

Hi Everyone,

 

I have a requirement to calculate the difference (%) based on previous row value, The condition is first sort the rows based on start date, if we have two rows with same start date it should pick based on lot number and we have to get the Previous Value based on the row previous value and compute Difference (%).

 

As I am a new to DAX, please can you help in writing dax logic.

 

Test data:

Start_Date lot NumberP(%)Previous ValueDifference (%)
01-03-2023 10001837289  

 4.13

0 (P(%)-Previous Value)/ Previous Value
01-03-2023100018376144.144.13 
02-03-2023100018391834.144.14 
02-03-2023100018391854.174.14 
03-03-2023100018392134.234.17 
04-03-2023100018401584.144.23 

 

Regards,

Sundar.

2 REPLIES 2
amitchandak
Super User
Super User

@SundarKumar , the offset function can help

Continue to explore Power BI Offset Compare Categories, Time Intelligence MOM, QOQ, and YOY: https://youtu.be/5YMlkDNGr0U

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

Dear Amit,

Thank you for the solution but small change in requirement that after sorting the rows based on Start date and lot number, we need to consider the first row as base and get the difference from remaining rows. In my example we need to consider 4.13 as base and 4.13 should come in Previous value feild and compute difference based on 4.13 value.

 

Regards,

Sundar

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.