Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Two Legends on Scatter chart

Hi there,

 

I'm looking for a way to add a second legend to my scatter chart. 

 

Currently I have my 

 

X-Axis: TimeStamp 

Y-Axis: Stats (Saving time) 

 

My legend right now is set to be the Microsoft  office version and I want to add a second legnd by using a boolen value (eg. If the file is saved on the local drive, Y. If the file is saved on the network server, then N). 

 

I don't see a way to add a second legend but it looks feasible. For example, I can use different color to represent my first legend and different shapes (dot,triangle,etc) to represent my second legend. 

 

Are there any methods to achieve that solution or anything similiar? Any help is greatly appreciated. 

 

 

  • Anonymous - What about using the Size field? You could set N = 1 and Y = 2 for example in a measure

6 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Greg_Deckler,amitchandak  thanks for the reply guys. For example, below is a very simple data set: 

      TIMESTAMP NetworkDriveSaving speed (in sec)OfficeVersion
      2020-09-03N21902
      2020-09-05Y51908
      2020-09-07N11908


      TimeSTAMP is unique for each entry. 

      I have my Y axis as saving speed, X axis as timestamp. 

      The legend is OfficeVersion, but I also like to show networkDrive on the chart. So the ideal graph would be like:

      Red dot for row1, Yellow triangle for row 2, Yellow dot for row 3. 

       

      If that makes sense. 

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        Anonymous - What about using the Size field? You could set N = 1 and Y = 2 for example in a measure

  • Anonymous , I doubt you have a secondary legend. Putting in another legend will remove the previous on.

     

    But if the legend is not any additional data point. Means details are al line level and legend only doing color. Then you can try a measure to conditional formatting. Using "Field Value" option

     Like

    color =
    switch ( true(),
    FIRSTNONBLANK('Table'[commodity],"NA") ="commodity1" && sum('Table'[Value]) >500,"lightgreen",
    FIRSTNONBLANK('Table'[commodity],"NA") ="commodity2" && sum('Table'[Value]) >1000,"lightgreen",
    // Add more conditions
    "red"
    )

     

    But this will only work when legend so adds rows data. And you can not use a legend if you want conditional formating

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, I am trying to find a solution to the same original problem as this thread. Is there any recent update in the visualizations which allows one to add a second legend to a scatter plot where the first legend is the color and the second legend is the marker shape, ie circle, triangle, etc?