Forum Discussion
Sum Measure across individual Columns
Hello,
I have a dataset that has # of loads for each week, then the AVG loads in the totals column. I have a measure (index1) that calculates the % difference from the avg, IF the # of loads for that week are > 0. Is there a way I can then sum the index1 values for each row? When I try to do this, it just uses the total of all weeks, rather than summing the values for each individual week.
Example (in yellow below): the avg loads across 5 weeks is 32. For each week, the index shows the % diff from the avg, IF > 0.
I want the total colum for index1 to show 0.59 (0.25 + 0.34), rather than 4.00, which is taking the % difference of the total loads for 5 weeks vs the avg.
I know about the possibility of using SUMX, SUMMARIZE, HASONEFILTER, ISFILTERED, etc. but I don't know how to apply it to this specific data.
Any ideas? Thanks in advance!
Anonymous You can use SUMX over week, so assuming you have a date table:
MEASURE = SUMX(VALUES(Date[WeekNumber]), [Index1])
Should get you close to what you need. Come back with the results and what's wrong/right about it if that's not perfect.
https://excelwithallison.blogspot.com/2020/09/what-does-average-mean.html
2 Replies
- AllisonKennedy
Community Champion
Anonymous You can use SUMX over week, so assuming you have a date table:
MEASURE = SUMX(VALUES(Date[WeekNumber]), [Index1])
Should get you close to what you need. Come back with the results and what's wrong/right about it if that's not perfect.
https://excelwithallison.blogspot.com/2020/09/what-does-average-mean.html
- AnonymousNot applicable
Thank you so much! This gave me exactly what I needed. One other question: do you know how I can sort my matrix by this new sum without it showing in each column? I'd be okay with it just being a subtotal column, but I don't need to see it at each week, if that makes sense.