We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I'm trying to compare 13 week averages and get the % change.
I have a table with all my values by date. I then have a table with date and 13 week period.
I am able to relate date with date and get averages by 13 week period but I cannot figure out how to compare to the previous period. I created an index column in my attempt.
The logic I'm thinking is MEASURE = ((AVERAGE(VALUE), INDEX) - (AVERAGE(VALUE), INDEX - 1 )) / (AVERAGE(VALUE), INDEX - 1)
I'm not sure if I'm on the right track or how to accomplish this. Thanks in advance!
(Acomplishing this with a filter value works but is undesirable)
Solved! Go to Solution.
@Anonymous
I believe you are having the right logic, I create the demo of Running Average, if you want average to a specific index, just change the filter to <=13, and <13.
Measure=
var currentaverage = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<=[Index]),'Table'[Value])))
var previousaverage = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<[Index]),'Table'[Value])))
Return (currentaverage - previousaverage) / previousaverage
Best,
Paul
@Anonymous
I believe you are having the right logic, I create the demo of Running Average, if you want average to a specific index, just change the filter to <=13, and <13.
Measure=
var currentaverage = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<=[Index]),'Table'[Value])))
var previousaverage = CALCULATE(AVERAGE([Value]),FILTER(ALL('Table'),MAXX(FILTER('Table',EARLIER('Table'[Index])<[Index]),'Table'[Value])))
Return (currentaverage - previousaverage) / previousaverage
Best,
Paul
I modified it slightly to :
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |