Forum Discussion

sipmester's avatar
sipmester
New Member
6 months ago
Solved

Show/Unshow elements in the legend

I have a line chart in Power BI with a date on the X-axis and three measures on the Y-axis (Fact, FC 2024, and FC 2025).

Fact and FC values come from different tables, and there is a page-level filter for FC versions (FC 2024, FC 2025). The Fact line should always be visible in the chart.

Currently, the FC line correctly disappears from the chart when its version is not selected in the filter. However, I would also like to remove the corresponding item from the legend when that FC measure has no values (i.e., when it is not selected).

Is it possible to hide a measure from the legend in a line chart when the measure has no data?

5 Replies

  • Hi sipmester , To help you better can you share the sample values , data model and the expected results ?

    Thanks If you found this helpful, please consider giving it a kudo and marking it as the accepted solution — it goes a long way in helping others facing the same issue.

    For more Power BI tips and discussions, let’s connect on LinkedIn:
    https://www.linkedin.com/in/natarajan-manivasagan

    Cheers
    !

  • Hi sipmester 

    Power BI does not have a built-in way to automatically hide legend entries when measures return no values. When a measure returns BLANK i.e., no data it still appears in the legend with an inactive appearance and the entry remains visible.

  • Hi sipmester 

     

    This isn't possible with individual measures. A workaround is to materialize the result of those measures in a disconnected table containing the measure names. Below is a sample. Actual approach may vary.

     

     

  • Hi sipmester, 

    Thank you for reaching out to the Microsoft Fabric Community Forum. Also, thanks to danextian, krishnakanth240, Natarajan_M,  for those inputs on this thread.

    Has your issue been resolved? If the response provided by the community member danextian, krishnakanth240, Natarajan_M, addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.

    Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

    Thank you for using the Microsoft Community Forum.

    • v-kpoloju-msft's avatar
      v-kpoloju-msft
      Icon for Community Support rankCommunity Support

      Hi sipmester, 

      Just wanted to follow up. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

      Thank you.