Forum Discussion

peterhui50's avatar
peterhui50
Helper III
3 years ago
Solved

Can this be done with the offset function?

 

 

Is this possible? I've hightlighted the result in red

 

I tried doing this OFFSET= CALCULATE( MAX(Roles), OFFSET(-1, ALLSELECTED(Employee), ORDERBY( Date,1)) but gives me an error.

 

 

 

 

  • Hi peterhui50 

     

    I can use this measure based on your sample data. 

    OFFSET Measure = CALCULATE( MAX('Table (2)'[Roles]), OFFSET(-1, ALLSELECTED('Table (2)'[Roles]), ORDERBY( 'Table (2)'[Roles],1)))

     

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

3 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi peterhui50 

     

    I can use this measure based on your sample data. 

    OFFSET Measure = CALCULATE( MAX('Table (2)'[Roles]), OFFSET(-1, ALLSELECTED('Table (2)'[Roles]), ORDERBY( 'Table (2)'[Roles],1)))

     

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