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
gvenkatesh482
Frequent Visitor

Offset Function not working on Month year dimension column and calculate

Hi Community,

I am trying to use offset function to get previous value for each row . So , i created a measure as shown below. 

 

However, it is not working as expected. Kindly assist on same. 

b =
    CALCULATE(average( [level_percentage]),OFFSET(-1,ALL('Monthly Calendar Table'[Month Year]),orderby('Monthly Calendar Table'[Month Year],asc)))

 

Screenshot 2022-11-01 153109.jpg

 

Venkatesh

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I guess [Month Year] column is sorted by another column. In case the sort-by-column is involved, the measure has to include this sort-by-column as well.

 

https://jihwankimcscp.wixsite.com/supplychainflow/post/when-can-i-use-offset-dax-function-in-power-b...

 

I hope this helps.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
gvenkatesh482
Frequent Visitor

Yes Thanks a lot @Jihwan_Kim . It worked . Thanks for sharing the link for reference. 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I guess [Month Year] column is sorted by another column. In case the sort-by-column is involved, the measure has to include this sort-by-column as well.

 

https://jihwankimcscp.wixsite.com/supplychainflow/post/when-can-i-use-offset-dax-function-in-power-b...

 

I hope this helps.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.