Forum Discussion

powerbi1986's avatar
powerbi1986
Frequent Visitor
4 years ago
Solved

Average selected month

hi, can someone assist me i would like to display average before and after in power bi      
  • v-angzheng-msft's avatar
    4 years ago

    Hi,  powerbi1986
    You could create measures like the following:

    average after =
    AVERAGEX(
        FILTER(
            ALLSELECTED( 'table' ),
            'table'[month] > SELECTEDVALUE( 'table'[month] )
        ),
        [value]
    )

    average before =
    AVERAGEX(
        FILTER(
            ALLSELECTED( 'table' ),
            'table'[month] <= SELECTEDVALUE( 'table'[month] )
        ),
        [value]
    )

     

    Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.

     

    Best Regards,
    Community Support Team _ Zeon Zheng

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