Forum Discussion

Housden996's avatar
Housden996
Helper II
1 year ago
Solved

Sparkline with Legend

Hi

 

I am wondering if its possible to replicate this bar / sparkline in a BI table / matrix:

 

Thanks.

 

  • To create a sparkline with a legend in a Power BI table or matrix, you can follow these steps:

    Create a Measure for Sparkline:
    Go to the “Modeling” tab and create a new measure that will be used for the sparkline. For example:
    SparklineMeasure = SUM('Table'[Value])

    Add a Table or Matrix Visual:
    Insert a table or matrix visual onto your report canvas.
    Add Data to the Visual:
    Drag the necessary fields (e.g., categories, dates) to the rows and columns of the table or matrix.
    Add the Sparkline:
    In the visualizations pane, go to the “Values” section and add the measure you created for the sparkline.
    Click on the down arrow next to the measure and select “Add sparkline”.
    Configure the Sparkline:
    In the sparkline settings, you can customize the type (e.g., line, column), color, and other properties to match your desired appearance.
    Add a Legend:
    To add a legend, you can use a separate visual like a card or a text box to describe what the sparkline represents.
    Alternatively, you can add a legend directly within the table or matrix by including additional columns that describe the data.

    Best Regards
    Saud Ansari
    If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

2 Replies

  • saud968's avatar
    saud968
    Memorable Member

    To create a sparkline with a legend in a Power BI table or matrix, you can follow these steps:

    Create a Measure for Sparkline:
    Go to the “Modeling” tab and create a new measure that will be used for the sparkline. For example:
    SparklineMeasure = SUM('Table'[Value])

    Add a Table or Matrix Visual:
    Insert a table or matrix visual onto your report canvas.
    Add Data to the Visual:
    Drag the necessary fields (e.g., categories, dates) to the rows and columns of the table or matrix.
    Add the Sparkline:
    In the visualizations pane, go to the “Values” section and add the measure you created for the sparkline.
    Click on the down arrow next to the measure and select “Add sparkline”.
    Configure the Sparkline:
    In the sparkline settings, you can customize the type (e.g., line, column), color, and other properties to match your desired appearance.
    Add a Legend:
    To add a legend, you can use a separate visual like a card or a text box to describe what the sparkline represents.
    Alternatively, you can add a legend directly within the table or matrix by including additional columns that describe the data.

    Best Regards
    Saud Ansari
    If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!

    • saud968's avatar
      saud968
      Memorable Member

      Housden996 was the above helpful

      Best Regards
      Saud Ansari
      If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!