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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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