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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
fortz
Regular Visitor

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.

 

fortz_3-1612560176024.png

 

Does someone know how to make this work?

 

This is an example of my original table:

 

fortz_2-1612560147139.png

 

I will appreciate your suggestions. 🙂

1 ACCEPTED SOLUTION
negi007
Community Champion
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

negi007_2-1612583870073.png

 

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

5 REPLIES 5
v-yuaj-msft
Community Support
Community Support

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.

v-yuaj-msft_0-1612849749349.png

 

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.

 

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 😉

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!

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

negi007_2-1612583870073.png

 

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

lbendlin
Super User
Super User

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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