Forum Discussion
DaveyP
8 years agoFrequent Visitor
Average Weekly Sales
Hi I am having trouble working out an average sales DAX expression, it is for a group of stores where the data table (Keys) contains one line per store per week, The issue i am facing is all...
- 8 years ago
GOT IT!!!
AWUS Actual =
VAR __CATEGORY_VALUES = VALUES('Keys'[MonDate])
RETURN
DIVIDE(
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE(SUM('Keys'[Royalties]) / DISTINCTCOUNT('Keys'[Store Name]))
),
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE(DISTINCTCOUNT('Keys'[MonDate]))
)
)
ChrisMendoza
8 years agoResident Rockstar
Well this is interesting...adding an Average Line, You get the $675 but I do not know how it's calculated.
Anonymous
8 years agoNot applicable
How about this solution?
1) create a measure
AWUS = AVERAGEX(VALUES(Table1[Week]),CALCULATE(AVERAGE(Table1[Sales])))
2) use matrix, set AWUS as Values.