Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

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...
  • v-jingzhang's avatar
    v-jingzhang
    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.