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
Anonymous
Not applicable

How to dynamically compare values for different records in Power BI?

Hi all, 

 

Hope everyone is safe and sound.

 

I have a list of records  which value is periodically measured and I need to calculate how much that value has changed for each record after the latest evaluation - to show in percentages whether the value has increased or decreased.

 

Could someone please advice what would be the correct way to accomplish this? Would sincerely appreciate any advice. 

mantastg_1-1623979934465.png

1 ACCEPTED SOLUTION

@Anonymous 

update the pbix file. you can create either a column or a measure for that

please see the attachment below





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@Anonymous 

is this what you want?

Measure 2 = 
var last=maxx(FILTER(all('Table'),'Table'[record]=max('Table'[record])&&'Table'[Date]<max('Table'[Date])),'Table'[Date])
var lastvalue=CALCULATE([Measure],FILTER(all('Table'),'Table'[record]=MAX('Table'[record])&&'Table'[Date]=last))
return DIVIDE([Measure]-lastvalue,lastvalue)

1.PNG

please see the attachment below





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

Proud to be a Super User!




Anonymous
Not applicable

Hi, @ryan_mayu . Many thanks for this. I am trying to reproduce it on my end.  Still find a bit difficult.

 

May I ask, why does record has value 15 twice on same date (2021-06-18) instead of 30? I am not able to modify my original data set to make it as your example.

mantastg_0-1623985782953.png

Therefore, I am not able to add the measure to the table the same way you did. 

mantastg_1-1623986074535.png

 

 

@Anonymous 

update the pbix file. you can create either a column or a measure for that

please see the attachment below





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

Proud to be a Super User!




Anonymous
Not applicable

Thank you very much for this!

you are welcome





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

Proud to be a Super User!




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.