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
DGUV
Frequent Visitor

Count filter in Map

Hello everyone,

I have a set of GPS-Coordinates. Before I plot them in PowerBI, I cluster it using the dbscan algorythm. If a point is in a cluster it gets the new center coordinates LAT2 and LON2. If not, it keeps the old coordinates.

 

Thus, my input table looks like this:

 

NrLatLonLat2Lon2Value
14040404010
23939404015
34141404020
45555          55.5           55.512
55656          55.5           55.513
6707070701
7101010108
8202020.520.510
9212120.520.530

 

Now I want to apply a filter where I can select only the data with more than 2 points in a cluster. (in this example row 1-3)

I believe that i have to use distinct() but i couldn't find a solution so far.

 

Thank's for your help!

3 REPLIES 3
CahabaData
Memorable Member
Memorable Member

Here's an outline of some ideas that may help;  first it looks like the Lat2 & Lon2 has right justified and left justified data - so you may have text and numbers co-mingled and you'll want to get the fields optioned for one data type.

 

Guessing that it is the combo of both Lat2 & Lon2 that you need distinct and counted - so you could create a calculated column & merge fields - so that in your model you have a single field to deal with.

 

VALUES is the function that will give you a distinct data set of new LatLon2 column - and that can be used to create a new separate table.

 

These are all modelling steps in the Query Editor.

 

You can join these tables together and then do count rows and go from there.  What comes next somewhat depends on what visuals you will be building.

 

 

 

www.CahabaData.com

Hi Cahaba,

 

thank you for your help so far. I created a seperate Table with my Distinct Lat2 values (i'll do the Lat&Lon combo later).

 

Unfortunately i couldn't follow your last step. Could you please specify?

 

Attached you can see the visuals I'm building. The first image shows all my datapoints (Lat, Lon). In the second image I used my Lat2/Lon2 coordinates.

I want to build a filter that allows me to exclude small clusters (e.g. less than 5 datapoints) in my map.

2017-08-25_09h04_29.png

 

 

 

 

 

 

 

 

 

 

 

 

 

Before the map visual one must first establish the correct data set.  So you'll want to work in a table visual as an interim step.

 

I suggest that the new calculated merged column LatLon2 is the field that should be used as the basis for counting rows - but you know your data better than I and if you think another field will always be valid go for it.  For now lets call it LatLon2

 

But you want to look at some examples of COUNTROWS - and create a measure that you can add to your table visual that counts how many rows/times the same LatLon2 appears/exists.  Call this CountLatLon. So for instance your first 3 rows this new column CountLatLon states 3 on each row, then next 2 rows states 2,  then 1, then 1, then 2, etc

 

Once this exists - then you have a basis to apply a filter for the value of CountLatLon.

 

 

www.CahabaData.com

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.