Forum Discussion

fortz's avatar
fortz
Regular Visitor
5 years ago
Solved

Difference between values of two previous dates

Hello,

 

I have a table that stores daily data related to the progress of projects. Therefore, a project has one row per day.
I'm interested in the difference of the %complete progress between the last two dates available in the table for each project name.

 

Similar to the table below, I need to present a matrix that contains the project name, the last 2 %complete values based on the last 2 dates, and the difference between those values.

 

 

Does someone know how to make this work?

 

This is an example of my original table:

 

 

I will appreciate your suggestions. 🙂

  • fortz  In this case, i suggest you to create threee measures

    1. Start_Value = CALCULATE (SUM (Project[Completion%]),FILTER(Project,Project[Date]=min(Project[Date])))

    2.  End_Value = CALCULATE (SUM (Project[Completion%]),FILTER(Project,Project[Date]=max(Project[Date])))

    3. Diff_2 = [End_Value]-[Start_Value]

    Below is the output basis date selection

     

     

5 Replies

  • negi007's avatar
    negi007
    Community Champion

    fortz  In this case, i suggest you to create threee measures

    1. Start_Value = CALCULATE (SUM (Project[Completion%]),FILTER(Project,Project[Date]=min(Project[Date])))

    2.  End_Value = CALCULATE (SUM (Project[Completion%]),FILTER(Project,Project[Date]=max(Project[Date])))

    3. Diff_2 = [End_Value]-[Start_Value]

    Below is the output basis date selection

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi fortz ,

     

    negi007 's solution is great. I want to add my idea if it can help you a little.

    According to the lastest 2 dates in a matrix, you can set the "date of change" filter as follows.

     

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

     

    Hope that's what you were looking for.

    Best Regards,

    Yuna

     

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

     

    • fortz's avatar
      fortz
      Regular Visitor

      Hello,

       

      I was able to create the matrix by creating the calculations suggested by negi007 

      However, I used a MAX() expression instead of the SUM()

       

      Thank you very much for your help!

    • julienvdc's avatar
      julienvdc
      Helper III

      Hey fortz is there a way to include that filter that you put on date of change into the measure?
      I am trying to display a similar measure inside a table visual and don't want to apply to filter to other elements of that visual 😉

  • Please provide sample data in usable format (not as a picture).