Forum Discussion
PowerBI calculate average (sumproduct) shows error data
- 6 years ago
Try like
Col_NVL = CALCULATE(
divide(sumx('NVL','NVL'[actual qty]*'NVL'[Total]),sum(NVL[actual qty])),ALLEXCEPT('NVL',NVL[Line.]),FILTER(,'NVL'[Week]<=max('NVL'[Week])))
move all expect outside filter.
Anonymous
Try something like this
averagex(summarize(Table,Table[Line No],Table[Workshop], "_avg", average(Table[ actual qty])),[_avg])
No, it's wrong, what I need is average of " sum(build QTY*total)/sum(Build QTY), I tried to add "*", but failed in average().
- amitchandak6 years ago
Super User
Anonymous ,
Try like
averagex(summarize(Table,Table[Line No],Table[Workshop],"_1",sumx(Table,Tablew[build QTY]*Table[total]), "_avg", sum(Table[Build QTY])),divide([_1],[_2])) - Anonymous6 years agoNot applicable
Hi Anonymous not sure your MAX(week)...for cumulative? So I did not add this filter, you may modify it
VAR T1 = GROUPBY(NVL,NVL[Line No.],"SUMP",SUMX(CURRENTGROUP(),NVL[actual qty]*NVL[Total]),"TT",SUMX(CURRENTGROUP(),NVL[actual qty]))RETURNDIVIDE(MAXX(T1,[SUMP]),MAXX(T1,[TT]))- Anonymous6 years agoNot applicable
Anonymous
系统显示, the syntax for "return" is incorrect.
- Anonymous6 years agoNot applicable
Anonymous result shows, all lines output are the same, actually not. would you pls have a look the data which I sent to v-kelly-msft , I don't want to accumulate it, but if I remove <=max(), then all line data are the same
Workshop Line. Week 02bbbb
W Line 131 WK14 230
W Line 30 WK14 230
W Line12N WK14 230
W Line12Q WK14 230
W Line29 WK14 230