Forum Discussion

ecoale's avatar
ecoale
Helper I
8 years ago
Solved

Students variations year over year

Good morning, I need help.......   I have imported (by Excel) a dataset "Students", with 3 coloumns: Student ID, Sex (M/F) and Year (from 2009 to 2016). Thanks to the Power BI Matrix item...
  • v-chuncz-msft's avatar
    8 years ago

    ecoale,

     

    You may refer to the following measure.

    Measure =
    VAR y =
        SELECTEDVALUE ( Students[Year] )
    VAR prev =
        CALCULATE ( COUNT ( Students[Student ID] ), Students[Year] = y - 1 )
    RETURN
        IF ( NOT ( ISBLANK ( prev ) ), COUNT ( Students[Student ID] ) - prev )
    
  • v-chuncz-msft's avatar
    v-chuncz-msft
    8 years ago

    ecoale,

     

    Just change it as follows.

    DIVIDE ( COUNT ( Students[Student ID] ) - prev, prev )