Forum Discussion
Anonymous
5 years agoNot applicable
Creating Dynamic Weighted Average
Hi Community, I am trying to create a weighted average measure in Power BI. However, the weight I'm using is being driven by another unrelated column (for example, I'm trying to find the weighted...
CNENFRNL
5 years agoCommunity Champion
Hi, Anonymous , it's a bit tricky to understand what's going on under the hood for SUM(); it's a syntactic sugar for SUMX(), which is designed to make things easier to read or to express. So, the measure
Total Employees = SUM(Sheet1[Number of Employees])
corresponds to:
Total Employees = SUMX(Sheet1, Sheet1[Number of Employees])
Sheet1 is always subject to the filter context in which it's used, e.g. at subsidiary level as current level, it's filtered down to subsidiary; at parent level, it's filtered down to parent level accordingly; but to my understanding, you need a sum up at parental level of current level.
You might want to refer to this article for such a dynamic sum up of parental level.