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.
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?
ProductId | Date | Value |
1 | 21/05/2021 | 100 |
1 | 15/06/1021 | 150 |
1 | 02/11/2021 | 75 |
2 | 10/02/2021 | 150 |
2 | 16/07/2021 | 175 |
2 | 01/08/2021 | 125 |
Solved! Go to Solution.
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
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
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
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |