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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
peterhui50
Helper III
Helper III

Can this be done with the offset function?

 

peterhui50_1-1665083843334.png

 

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.

 

 

 

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
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)))

vjingzhang_0-1665132423266.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

3 REPLIES 3
v-jingzhang
Community Support
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)))

vjingzhang_0-1665132423266.png

 

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

Is there a way to make the same code but without using offset and orderby?

I need the same formula, but the version I have doesn't allow me to use those features

Hi,

PBi file attached.

Hope this helps.

Ashish_Mathur_0-1709350701423.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors