Forum Discussion

bruleyn's avatar
bruleyn
Icon for Advocate I rankAdvocate I
9 years ago
Solved

Change legend text based on measure/column

I would like to change "Comparison 1 Line" legend entry to match the particular comparison type for a particular row, so that the table may be filtered for a particular measure and have the corresponding comparison label, e.g. "Goal" or "National Standard." Is this possible?

 

I know I can use a card to return a certain field in the currently filtered row--would I need to create an image for the blue circle and create the legend item manually, or is there an easier way? (Some rows don't need the constant line comparison, so it would be nice to be able to hide the legend item when there is no data-- currently I just set the value to 0 if there is no data.)

  • bruleyn

    AFAIK, it is not possible to hide the legend item when there's no data. You can submit your request at Power BI Ideas.

     

    As a workaround, you can try to put the legend column in a slicer, only the selected legends would be displayed.

2 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Icon for Microsoft Employee rankMicrosoft Employee

    bruleyn

    AFAIK, it is not possible to hide the legend item when there's no data. You can submit your request at Power BI Ideas.

     

    As a workaround, you can try to put the legend column in a slicer, only the selected legends would be displayed.

    • bruleyn's avatar
      bruleyn
      Icon for Advocate I rankAdvocate I

      Would it be possible to do this if I used the R programming language or some other development process?