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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Super User
Super User

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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