Forum Discussion
Data Labels vs. Total Labels in Clustered Column Charts
Hello,
I’m working with a clustered column chart (which visually resembles a stacked column chart), and I’m trying to display the total values for each column.
Here’s what I’m aiming for:
- If I select type 1, I want the chart to show the total value for that column, as illustrated in the screenshot.
- If I select type 1 and type 12, I want the chart to show the combined total for both, again as shown in the screenshot.
However, when both options are enabled, I end up with duplicate data labels for each type (e.g., Type 1 and Type 2), which makes the chart cluttered and confusing, see the screenshot for reference.
I’m having trouble getting this to work properly. I’ve tried toggling both “Data Labels” and “Total Labels”, but neither gives the desired result.
Any suggestions on how to fix this would be greatly appreciated. Power BI file is here.
Thank you!
The code works fine when I kept both Data Labels and Total Labels turned on.
Data_Label = VAR SelectedTypes = ALLSELECTED(type_sort[type]) VAR SelectedCount = COUNTROWS(SelectedTypes) RETURN IF( SelectedCount = 1 && MAX(type_sort[type]) IN { "type-1", "type-2", "type-3" }, [describeMeasure], BLANK() )If I select only type-1
If I select combination of type-1/type-2/type-3
If I select only type-12
If I select any combination of type-1/type-2/type-3/type-12
Note: While ChatGPT provided the final working code, I had already shared the initial code, expected output, and other relevant details. It took a few iterations to get everything functioning correctly.
Thanks to everyone who engaged with my post and offered helpful suggestions, your input was truly appreciated!
5 Replies
- BmejiaSuper User
Could you just turn off the Data Labels and leave the Total Labels on.
- v-karpurapudCommunity Support
Hi 0Experience
Thank you for contacting the Microsoft Fabric Community Forum.
We reviewed the PBIX file you provided. To display the totals correctly, you just need to turn off Data labels and keep Total labels on, as Bmejia suggested. This will fix the issue.
Please see the attached screenshot for reference.I hope this information is helpful. . If you have any further questions, please let us know. we can assist you further.
Regards,
Microsoft Fabric Community Support Team.- 0ExperienceHelper III
Thank you both for your responses.
I had already tried the method you suggested before posting. However, when the "Data Label" option is turned off, selecting a single item from the slicer does not display the data value.
Please note that the "Total Labels" option is turned on, even though it appears off in the screenshot below when a single selection is made. "Total Labels" automatically turns on when multiple selections are made.
- v-karpurapudCommunity Support
Hi 0Experience
In Power BI stacked column or bar charts, Total labels are visible only when there are two or more series stacked together. If a slicer or filter reduces the chart to a single series, Power BI treats it as a single column, so total labels are hidden. You can enable Data labels to show values for a single series, but when multiple series are selected, this can lead to duplicate labels for each series, which may not be ideal. Currently, Power BI does not allow conditional switching between Data labels and Total labels, so total labels will not appear for single series selections. If needed, you might explore third-party visuals from AppSource, like Enhanced Stacked Column/Bar, which provide more options for custom and conditional label formatting.
Regards,
Karpurapu D.
- 0ExperienceHelper III
The code works fine when I kept both Data Labels and Total Labels turned on.
Data_Label = VAR SelectedTypes = ALLSELECTED(type_sort[type]) VAR SelectedCount = COUNTROWS(SelectedTypes) RETURN IF( SelectedCount = 1 && MAX(type_sort[type]) IN { "type-1", "type-2", "type-3" }, [describeMeasure], BLANK() )If I select only type-1
If I select combination of type-1/type-2/type-3
If I select only type-12
If I select any combination of type-1/type-2/type-3/type-12
Note: While ChatGPT provided the final working code, I had already shared the initial code, expected output, and other relevant details. It took a few iterations to get everything functioning correctly.
Thanks to everyone who engaged with my post and offered helpful suggestions, your input was truly appreciated!