Forum Discussion

Ormesome's avatar
Ormesome
Helper II
8 years ago
Solved

Map visualisation with multiple datasets?

I've got 2 datasets to present. The first is a list of offices and their addresses. The second is a list of postcodes covered by each office.

 

Ideally I'll show a map with a pin/bubble indicating the location of each office and the postcodes coloured by office to show coverage.

 

To get across the line, I used a "Filled Map" with a legend to generate the coverage and a "Map" to generate the pins/bubbles. I then used an image editing tool to overlay them to create the final image for distribution. This is going to be tedious to perform on an ongoing basis.

 

Are there any visualisatons that can do what I'm after?

 

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    HI Ormesome,

     

    Based on test, current power bi not support auto determine the relationship mapping on Multi-records to Multi-records.

     

    On my opinion, I'd like to suggest merge and append these columns to one table, then use it as the source of map visual.

     

    Steps:
    1. Duplicate 'Catchments' table.
    2. Add custom column postcode to lookup value from 'CatchmentPostcodes' table.

    =Function.Invoke((id as any) => Table.SelectRows(CatchmentPostcodes,each [CatchmentID]= id),{[CatchmentID]})[Postcode]

    3. Add custom column Address to lookup values from 'CatchmentOffices' table.

    =Function.Invoke((id as any) => Table.SelectRows(CatchmentOffices,each [CatchmentID]= id),{[CatchmentID]})[Address]

    4. Expand above columns to new row.

     

    Result:

     

    Full query:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLMy0stUiguTSotSipWitWJVjICivrlF5VkpBbloUgYAyWC80sxJUyAEq6JxSXo4qZA8fBUNPFYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [CatchmentID = _t, Description = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"CatchmentID", Int64.Type}, {"Description", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Postcode", each Function.Invoke((id as any) => Table.SelectRows(CatchmentPostcodes,each [CatchmentID]= id),{[CatchmentID]})[Postcode]),
        #"Added Custom1" = Table.AddColumn(#"Added Custom", "Address", each Function.Invoke((id as any) => Table.SelectRows(CatchmentOffices,each [CatchmentID]= id),{[CatchmentID]})[Address]),
        #"Expanded Postcode" = Table.ExpandListColumn(#"Added Custom1", "Postcode"),
        #"Expanded Address" = Table.ExpandListColumn(#"Expanded Postcode", "Address")
    in
        #"Expanded Address"

     

    Regards,

    Xiaoxin Sheng

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Ormesome,

     

    I think you should create a mapping table to link these tables with 'both' cross filter direction. Then use address as the location and use postcode as legend.

     

    In addition, it will be help if you share some sample data to test.

     

    Notice: if your data contains some privacy data, you can remove these part or make some fake data with similar table structure.

     

    Regards,

    Xiaoxin Sheng

    • Ormesome's avatar
      Ormesome
      Helper II

      This is the schema (the spec changed from one office per catchment to many offices):

       

      CatchmentPostcodes - Catchments - CatchmentOffices

      [sorry, the forum won't let me insert the screenshot today]


      And some anonymised sample data (using McDonalds restaurants) is:

       

      Catchments
      CatchmentIDDescription
      1Inner suburbs
      2Northern suburbs
      3Southern suburbs
      4Eastern suburbs
      5Western suburbs

       

      CatchmentPostcodes
      CatchmentIDPostcode
      14006
      14000
      14001
      14101
      24010
      24035
      24017
      24034
      34110
      34115
      34103
      34108
      44171
      44153
      44152
      44170
      54070
      54060
      54066
      54065

       

      CatchmentOffices
      CatchmentIDAddress
      1Eagle St Pier, Brisbane Queensland 4000
      2179 Sandgate Road, Albion Queensland 4010
      3Elizabeth Street, Acacia Ridge, Brisbane
      3333 Ipswich Road, Annerley Queensland 4103
      41006 Wynnum Road, Cannon Hill Queensland 4170

       

       

      As you can see, the model allows a given catchment to cover many postcodes and to have several offices per catchment.

       

      I want to take a map and colour the postcodes of catchment "Inner Suburbs" blue with dots to show the location of offices in the catchment.
      I want to take the same map and colour the postcodes of catchment "Northern Suburbs" red with dots to show the location of offices in that catchment.
      etc.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI Ormesome,

         

        Based on test, current power bi not support auto determine the relationship mapping on Multi-records to Multi-records.

         

        On my opinion, I'd like to suggest merge and append these columns to one table, then use it as the source of map visual.

         

        Steps:
        1. Duplicate 'Catchments' table.
        2. Add custom column postcode to lookup value from 'CatchmentPostcodes' table.

        =Function.Invoke((id as any) => Table.SelectRows(CatchmentPostcodes,each [CatchmentID]= id),{[CatchmentID]})[Postcode]

        3. Add custom column Address to lookup values from 'CatchmentOffices' table.

        =Function.Invoke((id as any) => Table.SelectRows(CatchmentOffices,each [CatchmentID]= id),{[CatchmentID]})[Address]

        4. Expand above columns to new row.

         

        Result:

         

        Full query:

        let
            Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUfLMy0stUiguTSotSipWitWJVjICivrlF5VkpBbloUgYAyWC80sxJUyAEq6JxSXo4qZA8fBUNPFYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [CatchmentID = _t, Description = _t]),
            #"Changed Type" = Table.TransformColumnTypes(Source,{{"CatchmentID", Int64.Type}, {"Description", type text}}),
            #"Added Custom" = Table.AddColumn(#"Changed Type", "Postcode", each Function.Invoke((id as any) => Table.SelectRows(CatchmentPostcodes,each [CatchmentID]= id),{[CatchmentID]})[Postcode]),
            #"Added Custom1" = Table.AddColumn(#"Added Custom", "Address", each Function.Invoke((id as any) => Table.SelectRows(CatchmentOffices,each [CatchmentID]= id),{[CatchmentID]})[Address]),
            #"Expanded Postcode" = Table.ExpandListColumn(#"Added Custom1", "Postcode"),
            #"Expanded Address" = Table.ExpandListColumn(#"Expanded Postcode", "Address")
        in
            #"Expanded Address"

         

        Regards,

        Xiaoxin Sheng

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi guys, Anonymous Ormesome 

     

    I use the map vizualization to accomplish something similar - I have a map displaying where my colleagues live (location) and how many colleagues live in that town (size of bubble)

    I would like to add circles with a defined size (cluster size, in km, see image) with the center as a fixed town (cluster center, see image).

    The sizes of the bubbles are 0-5km; 6-10, 11-15, 16-20 etc. always +5

    How can i accomplish this without not being able to zoom in anymore and have the dynamic beauty of the map visual?

     

    Thanks heeps in advance.

    Jonas