Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I wonder if it's possible to calculate each row value distance compared to other rows in a column.
An example:
I know the method to create this in Excel, but I was hoping for some insight into recreating this in PBI, since Excel is limited to 16k columns
The objective is to count the number of ocorrences, given an max distance. Like an heatmap but with numbers 🙂
Solved! Go to Solution.
Hi @some1else ,
You need Latitude and Longitude to calculate the distance between two locations with following formula:
=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon2-lon1))*6371
Reference:
Distance Calculation in Power BI
How to calculate lat/long distance
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @some1else ,
You need Latitude and Longitude to calculate the distance between two locations with following formula:
=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon2-lon1))*6371
Reference:
Distance Calculation in Power BI
How to calculate lat/long distance
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Calculate all the distances in Power Query, then import the table into Power BI. The table can be of the form:
Left Point | Right Point | Distance
------------------------------------
From this it'll be dead easy to create what you want.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.