Forum Discussion

drcsjc's avatar
drcsjc
Frequent Visitor
3 years ago
Solved

Customized Data Labels that show for a selected column

Hi,

 

I am looking for any help that can be given in creating data labels for a stacked bar chart where the data labels only display for a selected column, e.g. far righthand as below.

 

I am trying to achieve this from Excel:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The closest I can get so far in PowerBi Desktop is this:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I am unable to turn off or de-select the data labels for the initial 13 columns to leave behind just the data labels on the final righthand column that is standing alone. 

 

Would greatly appreciate feedback from anyone who has ideas on how this might be achieved?

 

Best 

 

DC 

  • Hello 

    Try to use the transparency color code "#FFFFFF00", i don´t know if it works in all visuals but you can try:

     

    IF(SELECTEDVALUE('A Xaxis Sort1'[Statement-Date_Text])="SAAW", "Black", "#FFFFFF00" )

     

    Best regards

    Bruno Costa | Solution Supplier

     

    Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

    Take a look at the blog: PBI Portugal 

     

7 Replies

  • onurbmiguel_'s avatar
    onurbmiguel_
    Power Participant

    Hello drcsjc

     

    My suggestion is that you creat a measure for the color ,use transparent color and specific color, to setup what you want and then use the function botton in the color label:

     

     

    Best regards

    Bruno Costa | Solution Supplier

     

    Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

    Take a look at the blog: PBI Portugal 

     

    • drcsjc's avatar
      drcsjc
      Frequent Visitor

      Hi Bruno,

       

      Thanks, a partial success but wondered if you had any ideas on why the grey (lowest catergory in each column stack) is keeping its labels in white for columns 1 to 12 and yet not 13. I used a colour measure as you suggested as follows:

       
      1 Asset Class Colour = IF(SELECTEDVALUE('A Xaxis Sort1'[Statement-Date_Text])="SAAW", "Black", "RGBA(0, 0, 0, 0)")

       

      'SAAW' is a text field title of final righthand column stack on the X-axis.

       

      The measure is used in the fx for the Data Labels/Value for color.  With 'Format Style' = 'Field Value' and 'What Field should we base this on ?' = 'Asset Class Colour' the outcome can be seen below 

       

       

       

       

      Any pointers to help me get rid of the white data labels in the columns 1-12? 

      Thanks  

       

      • onurbmiguel_'s avatar
        onurbmiguel_
        Power Participant

        Hello 

        Try to use the transparency color code "#FFFFFF00", i don´t know if it works in all visuals but you can try:

         

        IF(SELECTEDVALUE('A Xaxis Sort1'[Statement-Date_Text])="SAAW", "Black", "#FFFFFF00" )

         

        Best regards

        Bruno Costa | Solution Supplier

         

        Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

        Take a look at the blog: PBI Portugal 

         

    • drcsjc's avatar
      drcsjc
      Frequent Visitor

      PS,

       

      Just used the 'Reverse stack order' toggle in Visuals/Columns/Colors and the white labels disappeared. They return when the toggle is turned off to the correct stack order. Therefore, still doesnt solve the problem but might hint at whats causing it. Image below with 'Reverse stack order' toggle set to 'On'

       

       

      Shared in case it gives anyone an idea as to what might be causing this? 

       

      Thanks 

  • olgad's avatar
    olgad
    Resident Rockstar

    Hi, Dont specify white in your formula. 

    1 Asset Class Colour = IF(SELECTEDVALUE('A Xaxis Sort1'[Statement-Date_Text])="SAAW", "Black")

     

    or check whats the color that gray and instead of white lake it gray, gray labels on gray bars will not be visible. 

    • drcsjc's avatar
      drcsjc
      Frequent Visitor

      Hi olgad,

       

      I tried both of your suggestions but neither solved the problem. Making the labels grey worked until the fx was applied then they returned to white again. Removing "RGBA(0, 0, 0, 0)" from the measure resulted in all labels appearing Black.

         

      • olgad's avatar
        olgad
        Resident Rockstar

        What is in the x axis for those 12 bars? Did you add grey into a formula instead of white?