Forum Discussion
Syndicate_Admin
4 years agoAdministrator
Filter-weighted average
Good afternoon, please if someone can help me with a measure that can filter the result by weighting the Indicator with respect to the existing amount per Year / Center / Winery since in some I repea...
- 3 years ago
Hi Anonymous
Sorry for the late reply. You can create a measure with below DAX to get the weighted average indicator.
New Indicator = VAR _table = ADDCOLUMNS ( ADDCOLUMNS ( SELECTCOLUMNS ( 'Table', "Quantity", 'Table'[Quantity], "Indicator", 'Table'[Indicator] ), "Percentage of quantity", DIVIDE ( [Quantity], SUM ( [Quantity] ) ) ), "Apportionment", [Percentage of quantity] * [Indicator] ) RETURN SUMX ( _table, [Apportionment] )Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
v-jingzhang
3 years agoCommunity Support
Hi Anonymous
Sorry for the late reply. You can create a measure with below DAX to get the weighted average indicator.
New Indicator =
VAR _table =
ADDCOLUMNS (
ADDCOLUMNS (
SELECTCOLUMNS (
'Table',
"Quantity", 'Table'[Quantity],
"Indicator", 'Table'[Indicator]
),
"Percentage of quantity", DIVIDE ( [Quantity], SUM ( [Quantity] ) )
),
"Apportionment", [Percentage of quantity] * [Indicator]
)
RETURN
SUMX ( _table, [Apportionment] )
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Anonymous
3 years agoNot applicable
Thank you very much, it was perfect