Forum Discussion

Resh's avatar
Resh
New Member
6 years ago
Solved

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!

3 Replies

  • VijayP's avatar
    VijayP
    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

  • dax's avatar
    dax
    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.