Forum Discussion

bssdon's avatar
bssdon
Regular Visitor
1 year ago
Solved

Displaying multiple-select questions on map legend

I have data that comes from a multiple-select question that is stored in multiple columns like in the table below

Category of incidenceCategory of incidence/electricity offCategory of incidence/Flooded roadCategory of incidence/fallen treeCategory of incidence/leaning utility poleCategory of incidence/roof leakingCategory of incidence/partial house collapseCategory of incidence/otherLatitudeLongitude
Electricity off flooded road1100000  
fallen tree leaning utility pole electricity off1011000  
Partial house collapse0000010  
roof leaking electricity off1000100  
roof leaking flooded road other0100101  

 

I currently have the Category of Incidence field as the legend, but that ends up eventually being all possible permutations of all the categories. Like this

Is there any way that I can have a legend of one of each category like

  • Electricity off
  • Flooded Road
  • Fallen tree
  • Leaning Utility Pole
  • Roof leaking
  • Partial House collapse
  • Other

And make it so that clicking on one highlights all points on the map that contain that category? is that possible?

  • bssdon's avatar
    bssdon
    1 year ago

    Thank you very much! The link to the discussion with the similar issue helped immensely. Specifically the video that the user linked https://www.youtube.com/watch?v=rI0uHdBwgPY 

     

    To summarize, I had to add the Category of Incidence as a new query (and add an index column), split it into columns, then unpivot all columns except for the index.

5 Replies

  • bssdon you need to unpivot your data to make it work, what would be on the x-axis?

    • bssdon's avatar
      bssdon
      Regular Visitor

      I have another column for Location for the x-axis. How would I accomplish this? When I try unpivoting the columns it multiplies the number of rows. Apologies as I'm new to this.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi bssdon ,

        Thank you for your kind reply!

        What does all the data you have look like? Could you please describe in more detail the output you expect to get? It's normal for you to mention "When I try unpivoting the columns it multiplies the number of rows. ", We need more information to offer you more help! 

        Could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

        How to provide sample data in the Power BI Forum

        And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

        How to upload PBI in Community

        In addition, someone else had a similar issue like yours before, you could check out the link, hopefully it will help you have more ideas.

        Solved: Visual-level filters not working - Microsoft Fabric Community

        Best regards,

        Lucy Chen

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.