Forum Discussion
0Experience
Helper III
1 year agoShowing Only Total Labels for Stacked Bar Chart with Conditional DAX Logic
Hello, If I select single selection from slicer (type-1/type-2/type-3) then need to see the data value like below. If I select single selection from slicer (type-12 only) which is a...
- 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!
Greg_Deckler
Community Champion
1 year ago0Experience Is there a particular reason your relationship is not active? You should be able to solve this with conditional formatting for your Data Label values.