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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rlr5153
New Member

DAX Effective way of reading prior rows when sorted by time

Hi,

 

I am having a processing issue when the following column calculation is run on a large data set. I had to scale the data set down to 6,000 records to work.  Ideally I would like to run this on a data set larger then 600,000+ records. (also my desktop is running 32bit 😞  ).

 

Do you have any suggestions on a different way to write this function that will reduce the processing power needed?

 

 

 

The function is intended to grab the Latitude value in the record with the most recent date/time closest to the current record and find the difference in order to identify if the current record is a valid data point. 

 

LatAccuracy = if(abs((TBL_CROESystems[LATITUDE] - LOOKUPVALUE(TBL_CROESystems[LATITUDE],TBL_CROESystems[Date/Time],CALCULATE(max(TBL_CROESystems[Date/Time]),filter(all(TBL_CROESystems), TBL_CROESystems[Date/Time] < EARLIER(TBL_CROESystems[Date/Time])))))) >= .110, "OutofBounds", "InBounds")

 

 

Thank you in advance

1 REPLY 1
TomMartens
Super User
Super User

Hey,

 

not sure if there is a "low" impact algorithm, this is due to the nature of the algorithms that are basically used.

 

If you are familiar with R scripting you could give it a try, maybe this gets you started

https://stackoverflow.com/questions/27442506/find-nearest-points-of-latitude-and-longitude-from-diff...

 

By the way the rgeos package unfortunately is not supported on Power BI Service, for this reason it can just be used locally or in combination with Power BI gateway in personal mode

 

If you need help, I'm willing, but please be aware that I will request a sample of your dataset, with at least ID (just an integer) | LAT | LONG columns 🙂

 

Cheers

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors