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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

0

Data label value field in Line Chart not working when using multiple series and secondary y-axis

I am consistently experiencing an issue with the Line Chart visual in Power BI Desktop (current version, December 2023)

 

If I create a visual with more than one series, turn data labels on (Format visual - Data labels), select just one series in 'Apply settings to' (Format visual - Data labels - Apply settings to - Series) and set the data label value (Format visual - Data labels - Value - Field) to display a different field the value field is only displayed when the series is shown on the primary y-axis. If the that value is on the secondary y-axis, the value field is ignored and the original value for the series is shown in the data label.

 

Here are steps to recreate: 

Example, using the below csv data as a source, sample_data (Get data - Text/CSV - select file with CSV data matching below):

date,value
2024-01-01,971
2024-02-01,969
2024-03-01,966
2024-01-01,800
2024-02-01,800
2024-03-01,800

 

Adding three calculated measures : 

  • value_mean = AVERAGE('sample_data'[value])
  • value_sum = SUM('sample_data'[value])
  • display = 
         IF(ISBLANK(SUM('sample_data'[value])),

                   BLANK(),

                   FORMAT(TIME(TRUNC(DIVIDE(SUM('sample_data'[value]),60)),ROUND(MOD(SUM('sample_data'[value]),60),0),0),"Short Time")

 

Creating a Line Chart visual with the following values: 

 

tsmith2_0-1705442220218.png

Turning data labels on the visual on: 

 

tsmith2_1-1705442233916.png

 

Results in the following chart: 

tsmith2_2-1705442233917.png

Switching the data label value field to 'display' results i both values in the visual updating to the correct value: 

tsmith2_3-1705442255624.png

 

 

tsmith2_4-1705442255625.png

Moving value_sum to the secondary axis has no impact to the displayed data labels on each line (from my 'display' field): 

 

tsmith2_5-1705442269988.png

 

 

tsmith2_6-1705442269989.png

If unset the value field in the 'All' Series the data labels to no longer utilize a value field, the data labels switch back to their original values: 

 

tsmith2_7-1705442281031.png

 

 

tsmith2_8-1705442281032.png

If I now change the value field on the data labels for just the 'value_sum' series (currently on secondary y-axis) to the 'display' field, the graph does not change. As we saw previously, the 'display' value for date 2024-02-01 is '05:29', and this series should be showing the 'display' value, but instead, but instead I am still seeing the same 1769 (actual value of 'value_sum' series): 

 

tsmith2_9-1705442294373.png

 

 

tsmith2_10-1705442294375.png

If I move the 'value_sum' field back to the primary y-axis, the displayed data label updates to correctly utilize the 'display' value (of '05:29') configured in the data label value field: 

 

tsmith2_11-1705442308179.png

 

 

tsmith2_12-1705442308181.png

 

So it seems the value field is not being respected on a line chart where there are multiple series, and the value field is only set on a single series.

 

This seems like a true bug? Has anyone else experienced this? 

Status: Delivered
Comments
Anonymous
Not applicable

Hi @Anonymous ,

 

This behavior is expected, if the top-level data label toggle is enabled, all series get data labels. If you only wants one series to be labeled, you need to subsequently disable the labels for all other series.

 

If you would like to suggest feature improvements, you may vote the idea and comment here to improve this feature. It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,
Community Support Team _ Caitlyn

rodrigoavf
Regular Visitor

I am sorry @Anonymous but @Anonymous is right, and this can't be an expected behaviour as you said.

I have the same issue, can't add a custom data label to the secondary Y axis, even if I do as you suggested, disabling all labels from the main Y axis and having it only on the secondary one. But it works fine the moment I move the data from the secondary to the main Y axis.

This makes it impossible to have 2 series with very different Y values in the same chart with custom labels.

rodrigoavf
Regular Visitor

@Anonymous  I found a solution, this is still a bug in my opinion, and not an expected behaviour.

To make it work you'll have to add the measure you want in the second Y axis to the field of ALL and then idividually set the measure on the field of the series in the main Y axis.

Step by step

  1. On "Apply Setting To" select All
  2. Add what you wish to be the label on the 2nd Y axis in "Field" under "Value"
  3. Change "Apply Settings To" to the other fields in your main Y axis, and set what you wish to be their Y axis Label

 

I don't know if this would work if you have 2 series on the 2nd Y axis.