Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

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 repeat the winery with different indicator.

YearAreaCenterWine cellarQuantityIndicator
2018EleventhRabudos10148.0291,98
2018EleventhRabudos10242.9473,60
2018EleventhRabudos10213.0802,40
2018EleventhRabudos10350.8001,98
2018EleventhRabudos10449.3003,64
2018EleventhRabudos10550.8002,42
2018EleventhRabudos10649.8563,64
2018EleventhRabudos10750.8002,13
2018EleventhRabudos10851.7441,50
2018EleventhRabudos10950.8002,13
2018EleventhRabudos11022.5561,61
2018EleventhRabudos11028.2441,50
2018EleventhRabudos11150.8001,50
2018EleventhRabudos11251.0611,43
2018EleventhRabudos11350.8001,50
2018EleventhRabudos11425.8301,25
2018EleventhRabudos11424.3831,61
2018EleventhRabudos11550.8293,00
2018EleventhRabudos11650.9441,50
2018EleventhRabudos11750.8103,30
2018EleventhRabudos11850.5871,65
2020EleventhRabudos10151.7043,84
2020EleventhRabudos10250.8002,45
2020EleventhRabudos10351.6873,37
2020EleventhRabudos10450.8003,70
2020EleventhRabudos10551.4003,08
2020EleventhRabudos10641.3001,21
2020EleventhRabudos1064.0002,60
2020EleventhRabudos1065.5002,86
2020EleventhRabudos10750.8003,81
2020EleventhRabudos10850.8003,38
2020EleventhRabudos10950.8003,36
1 ACCEPTED SOLUTION

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] )

vjingzhang_0-1662448026881.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

4 REPLIES 4
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

Thank you for providing the sample data. It is very helpful. However currently I don't understand what the expected result should be like. Can you explain how to weight and filter with some examples? For example, in 2018, Wine cellar 102 is repeated, how do you want to deal with it? 

 

Best Regards,
Community Support Team _ Jing

Thank you for the help lcreo to solve it in this way:
Indicator = SUMX('tabla1',('Bi Sowing'[Quantity])*('table1' [indicator]))/sum('table1' [Quantity])
I have filter by year and center on the sheet, the idea is that for cases that are repeated the indicator is representative according to the center / winery according to the amount that each indicator has
YearCenterWine cellarQuantity IndicatorPercentage of quantityApportionment
2018Rabudos102429473,677%2,75954808
2018Rabudos102130802,423%0,56030128
56027 3,32

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] )

vjingzhang_0-1662448026881.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

Thank you very much, it was perfect

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.