Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am using the following expression to get a SUMPRODUCT measure, which gives me the weighted average [Interest Rate] based on [Capital].
In some cases, [Interest Rate] = 0 because there's no loan outstanding, but the expression then has too high a denominator. If I insert
Asset ID | Capital | Interest Rate |
A | 2200 | 9% |
B | 3330 | 5% |
J | 1600 | 0% |
Desired Output | 6.59% | |
Current Output | 5.11% |
Solved! Go to Solution.
@mrothschild - The following Measure should work. It first removes the 0-interest rows and then performs the weighted average.
Weighted =
var _desired_rows = FILTER(Rates, Rates[Interest Rate] > 0)
return DIVIDE(
SUMX(_desired_rows,[Interest Rate] * [Capital]),
SUMX(_desired_rows,[Capital])
)
@mrothschild - The following Measure should work. It first removes the 0-interest rows and then performs the weighted average.
Weighted =
var _desired_rows = FILTER(Rates, Rates[Interest Rate] > 0)
return DIVIDE(
SUMX(_desired_rows,[Interest Rate] * [Capital]),
SUMX(_desired_rows,[Capital])
)
Thanks so much - works perfectly!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |