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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
bml123
Post Patron
Post Patron

Product value trends

HI,

 

I have this data as below and I need to show how the value has changed over time. I need to show by how much percentage it has changed from the beginning till now.  Also need to show how much % it has changed year on year.  How do I achieve that?

 

ProductIdDateValue
121/05/2021100
115/06/1021150
102/11/202175
210/02/2021150
216/07/2021175
201/08/2021125
1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @bml123 ,

Please have a try!

Create measures.

min_result = 
var min_date =
CALCULATE(MIN('Table'[Date]),FILTER(ALL('Table'),'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))))
var a_value=CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]=min_date&&'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))))
return a_value
diff% = var diff= SELECTEDVALUE('Table'[Value])-[min_result]
var change = DIVIDE(diff,SELECTEDVALUE('Table'[Value]))
return change
_year = var last= CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))-1))
var now= CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))))
var aaa = now-last
var result_change = DIVIDE(aaa,now)
return result_change

12121212.PNG

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

 

Best Regards

Community Support Team _ Polly

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @bml123 ,

Please have a try!

Create measures.

min_result = 
var min_date =
CALCULATE(MIN('Table'[Date]),FILTER(ALL('Table'),'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))))
var a_value=CALCULATE(MAX('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]=min_date&&'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))))
return a_value
diff% = var diff= SELECTEDVALUE('Table'[Value])-[min_result]
var change = DIVIDE(diff,SELECTEDVALUE('Table'[Value]))
return change
_year = var last= CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))-1))
var now= CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[ProductId]=MAX('Table'[ProductId])&&YEAR('Table'[Date])=YEAR(MAX('Table'[Date]))))
var aaa = now-last
var result_change = DIVIDE(aaa,now)
return result_change

12121212.PNG

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

 

Best Regards

Community Support Team _ Polly

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.