Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
mgunnin
Frequent Visitor

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

 

 

mgunnin_1-1669001933659.png

 

1 ACCEPTED SOLUTION

Hi @mgunnin ,

 

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

vstephenmsft_1-1669182776062.png

 

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

vstephenmsft_2-1669182788395.png

 

 

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.

View solution in original post

8 REPLIES 8
JusticeJr
Frequent Visitor

Power BI has just introduced Custom Label for data labels. I think it will solve the problem.

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

v-stephen-msft
Community Support
Community Support

Hi @mgunnin ,

 

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 )

vstephenmsft_0-1669108201808.png

 

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.

 

 

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.

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.

mgunnin_2-1669161052718.png

 



Hi @mgunnin ,

 

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

vstephenmsft_1-1669182776062.png

 

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

vstephenmsft_2-1669182788395.png

 

 

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.

I was afraid that was the answer, but I certainly appreciate the confirmation and assistance. Thank you!!!

mgunnin
Frequent Visitor

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.