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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Resh
New Member

Calculate difference between values in the same column

Hi all,  I'm new to Power BI and need help. I am trying to find the difference between two values, where: I have a table, what I want to see is how Project X or Project Y have increased or decreased in value over time. As I want to illustrate the change in a bar graph.  I know I need to create a new column/measure, but not sure how to go about it, using the project name and date as the criteria to work out the difference.

 

Project Value Date

Project X 200 Jun-19

Project X 200 Jul-19

Project X 300 Aug-19

Project Y 5000 Jun-19

Project Y 5500 Jul-19

Project Y 6000 Aug-19

Thanks!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

Try Earlier function

 

https://community.powerbi.com/t5/Desktop/Explanation-of-the-EARLIER-formula/td-p/529469

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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

dax
Community Support
Community Support

Hi Resh,

You could try to use below measure to get difference between each month.

trend = SUM('Table (2)'[Value])-CALCULATE(SUM('Table (2)'[Value]), FILTER(ALLEXCEPT('Table (2)','Table (2)'[Project]),MONTH('Table (2)'[Date])=MONTH(MIN('Table (2)'[Date]))-1))

Best Regards,
Zoe Zhi

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

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi Resh,

You could try to use below measure to get difference between each month.

trend = SUM('Table (2)'[Value])-CALCULATE(SUM('Table (2)'[Value]), FILTER(ALLEXCEPT('Table (2)','Table (2)'[Project]),MONTH('Table (2)'[Date])=MONTH(MIN('Table (2)'[Date]))-1))

Best Regards,
Zoe Zhi

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

Try Earlier function

 

https://community.powerbi.com/t5/Desktop/Explanation-of-the-EARLIER-formula/td-p/529469

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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
VijayP
Community Champion
Community Champion

Is this data in single column or split across columns.

IF it is in single column you need to split Column

if different columsn you can create measure and then make the visualisation. Please take the Screenshot of your data and show here to give more clear answer




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.