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
Matt92
Helper I
Helper I

Group geolocation point

My business problem is:

We have millions of geolocation data points (lat-long) which should be visualized on a heatmap.

Currently, the Heatmap custom vis is restricted to 30.000 row fetch (outdated api is used by visualization, and the source code is not provided by the developer).

So I created a calculated table which helps to round the location points (quasi grouping, which reduces the number of geolocation points). Unfortunately, you lose some granularity with this solution, so my idea was, that I could give the opportunity to the user, to select the quality. Low means that the location values are rounded to 3, Medium means that the location values are rounded to 4 and so on. But it cannot work with calculated table, because it calculated when we refresh the report, and not when the user filters.

It would be a huge add, because if the user only want to see one specific country, he could use high quality, but if he want to see the full continent, he could use low quality.

 

Is it possible, to figure out something for this in Tabular? 

 

My basic approach is:

 

CalculatedTable= 
SELECTCOLUMNS (
positions;
"time"; positions[datetime];
"longitude"; ROUND(positions[Longitude];4
);
"latitude"; ROUND(positions[Latitude];4
);
"concatenated";CONCATENATE(ROUND(positions[Longitude];4);ROUND(positions[Latitude];4)
))
Output:=COUNT('CalculatedTable'[concatenated])
Points = DISTINCT(SELECTCOLUMNS('CalculatedTable';"concat";'CalculatedTable'[concatenated];"latitude";'CalculatedTable'[latitude];"longitude";'CalculatedTable'[longitude]))

I have relationship between the Points and CalculatedTable. In this case, I can put up only the distinct location points to the map, and use the output as "heat".

 

Any idea?

Thanks!

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Matt92,

 

I tested with below sample data. Please make sure there is a field that can identify each location uniquely, in my sample, it's [LocationID].

1.PNG

 

Create an extra table manually that lists all available selections. Place this field into slicer.

2.PNG

 

Please refer to below measures which should be added to HeatMap visual.

Lon measure =
VAR selectedType =
    SELECTEDVALUE ( 'Slicer Table'[quality] )
RETURN
    SWITCH (
        TRUE (),
        selectedType = "Low", ROUND ( SELECTEDVALUE ( positions[Longitude] ), 3 ),
        selectedType = "Medium", ROUND ( SELECTEDVALUE ( positions[Longitude] ), 4 ),
        selectedType = "High", ROUND ( SELECTEDVALUE ( positions[Longitude] ), 5 ),
        selectedType = BLANK (), SELECTEDVALUE ( positions[Longitude] )

Lat measure =
VAR selectedType =
    SELECTEDVALUE ( 'Slicer Table'[quality] )
RETURN
    SWITCH (
        TRUE (),
        selectedType = "Low", ROUND ( SELECTEDVALUE ( positions[Latitude] ), 3 ),
        selectedType = "Medium", ROUND ( SELECTEDVALUE ( positions[Latitude] ), 4 ),
        selectedType = "High", ROUND ( SELECTEDVALUE ( positions[Latitude] ), 5 ),
        selectedType = BLANK (), SELECTEDVALUE ( positions[Latitude] )
    )

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Matt92,

 

I tested with below sample data. Please make sure there is a field that can identify each location uniquely, in my sample, it's [LocationID].

1.PNG

 

Create an extra table manually that lists all available selections. Place this field into slicer.

2.PNG

 

Please refer to below measures which should be added to HeatMap visual.

Lon measure =
VAR selectedType =
    SELECTEDVALUE ( 'Slicer Table'[quality] )
RETURN
    SWITCH (
        TRUE (),
        selectedType = "Low", ROUND ( SELECTEDVALUE ( positions[Longitude] ), 3 ),
        selectedType = "Medium", ROUND ( SELECTEDVALUE ( positions[Longitude] ), 4 ),
        selectedType = "High", ROUND ( SELECTEDVALUE ( positions[Longitude] ), 5 ),
        selectedType = BLANK (), SELECTEDVALUE ( positions[Longitude] )

Lat measure =
VAR selectedType =
    SELECTEDVALUE ( 'Slicer Table'[quality] )
RETURN
    SWITCH (
        TRUE (),
        selectedType = "Low", ROUND ( SELECTEDVALUE ( positions[Latitude] ), 3 ),
        selectedType = "Medium", ROUND ( SELECTEDVALUE ( positions[Latitude] ), 4 ),
        selectedType = "High", ROUND ( SELECTEDVALUE ( positions[Latitude] ), 5 ),
        selectedType = BLANK (), SELECTEDVALUE ( positions[Latitude] )
    )

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks! Perfect solution!

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.

Top Solution Authors