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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
igaca
Helper III
Helper III

Strange EARLIER() result in Variance to Prev Row Value - Can anyone shed light on the result?

Am not understanding the last result...the -355.  Would have expected a return of 9.

Am also curious if someone can provide insight in how to modify the code to evaluate to BLANK() for the very first row given that there is no previous value to compare to and return a correct result?

 

Thanks!

 

Var to Prev DAX excerpt.png

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

 

This formula works

 

=if(ISBLANK(LOOKUPVALUE([Activs Cnt Col],Data[Data Date],CALCULATE(max([Data Date]),FILTER(Data,[Data Date]<EARLIER(Data[Data Date]))))),BLANK(),[Activs Cnt Col]-LOOKUPVALUE([Activs Cnt Col],Data[Data Date],CALCULATE(max([Data Date]),FILTER(Data,[Data Date]<EARLIER(Data[Data Date])))))

Untitled.png


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

View solution in original post

KHorseman
Community Champion
Community Champion

Your original version called for the max of [Activs Cnt Col] where the date was earlier than the current row. Look at all the values in that column on earlier dates. Of all the values on dates before 7/1, the max was 733 on either 4/30 or 5/3.

 

Perhaps you thought your formula would return the value of [Activs Cnt Col] where the date was the max before the current row? But that's not what your formula actually says.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

10 REPLIES 10

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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