Forum Discussion
Data Labels vs. Total Labels in Clustered Column Charts
- 1 year ago
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!
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.
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.