Forum Discussion

0Experience's avatar
0Experience
Icon for Helper III rankHelper III
1 year ago
Solved

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: I...
  • 0Experience's avatar
    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!