Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Customizing data labels

 

I'm trying to replicate the chart below in Power BI. I need the height of the bars to match the count, but would like the data labels to reflect the percentage of eac

 

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    Sorry for my previous misunderstanding.

    I understand now, you want the y-axis to display the values, and the data labels to show the percentages.

    This is not possible at the moment, but I recommend you try the tooltips function, which can display both values and percentages, as long as you place the mouse in the corresponding position.

     

    As a workaround, you can still set the display values on the y-axis, the data labels are still values, and you can additionally add the percentage you want in the tooltips.

     

    Tooltips are an elegant way of providing more contextual information and detail to data points on a visual. Please refer to

    Customizing tooltips in Power BI Desktop - Power BI | Microsoft Learn

     

    Or even you can add a tooltip page in a visual. Please refer to

    Create report tooltip pages in Power BI - Power BI | Microsoft Learn

     

     

    Best Regards,

    Stephen Tao

     

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

8 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      I just noticed this today! Thanks! Can't wait to dive in, our workaround we built is clunky, so hopefully this will work.

  • Anonymous's avatar
    Anonymous
    Not applicable

    the percentage of each count per quarters. (Sorry, it cut off the end when I submitted.)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You may need to create a separate measure and then calculate the values grouped by Legend and x-axis separately and the values by x-axis only, respectively, to get the percentage.

    Measure =
    VAR _sum =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                [Legand] = MAX ( 'Table'[Legand] )
                    && [Quarter] = MAX ( 'Table'[Quarter] )
                    && [Year] = MAX ( 'Table'[Year] )
            )
        )
    VAR _total =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                [Quarter] = MAX ( 'Table'[Quarter] )
                    && [Year] = MAX ( 'Table'[Year] )
            )
        )
    RETURN
        DIVIDE ( _sum, _total )
    

     

    Best Regards,

    Stephen Tao

     

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

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, Stephan. I don't think this quite gets me there (unless I'm missing part of it, which is very possible 🙂 )

      I need the Y-Axis to show the actual count with the data label showing the percentage of the count per quarter.

      • Anonymous's avatar
        Anonymous
        Not applicable

        The image below shows a table with the required fields. The Count Fields (three on the left) I need as the columns in the chart. The Count % fields (three on the right) I need as the data labels. Hope this clarifies what I'm looking for.