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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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