Forum Discussion

MichaelRensing's avatar
2 years ago
Solved

Weighted value

I have a set of data that has various projects, the project level % Reduction, and the projects total area.  There are other data point attached to the projects such as location and year.  I would li...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MichaelRensing 

    You can try the following code

    Measure =
    VAR a =
        SUMX (
            FILTER (
                ALLSELECTED ( 'Sheet1' ),
                [Project type]
                    IN VALUES ( 'Sheet1'[Project type] )
                        && [Year]
                            IN VALUES ( 'Sheet1'[Year] )
                                && [Location] IN VALUES ( 'Sheet1'[Location] )
            ),
            [Project Total Area]
        )
    RETURN
        DIVIDE (
            SUM ( 'Sheet1'[Project Total Area] ) * SUM ( 'Sheet1'[% Reduction] ),
            a
        )
    

    Output

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.