Forum Discussion
Anonymous
4 years agoNot applicable
DAX calculation for weighted average
Hi All - Hoping to find DAX help in calculating Weighted Average in power BI. In excel, I had my calculation as : Calculation for "Bond 1 and Bond 2" 1- How do I write that weight av...
- 4 years ago
Hi,
Please check the below picture and the attached pbix file whether it suits your requirement.
Only Bond weight avg: = DIVIDE ( SUMX ( FILTER ( Data, NOT ( Data[Category] IN { "String", "Stock" } ) ), Data[Balance] * Data[Rate] ), SUMX ( FILTER ( Data, NOT ( Data[Category] IN { "String", "Stock" } ) ), Data[Balance] ) )
Jihwan_Kim
Super User
4 years agoHi,
Please check the below picture and the attached pbix file whether it suits your requirement.
Only Bond weight avg: =
DIVIDE (
SUMX (
FILTER ( Data, NOT ( Data[Category] IN { "String", "Stock" } ) ),
Data[Balance] * Data[Rate]
),
SUMX (
FILTER ( Data, NOT ( Data[Category] IN { "String", "Stock" } ) ),
Data[Balance]
)
)
Anonymous
4 years agoNot applicable
Hi - Very much appreciated. Thank you so much