Forum Discussion

jarwest's avatar
jarwest
Helper II
2 years ago
Solved

Custom Data Labels Not Always Changing to Selected Field

Hey all,

 

I'm building a clustered column chart with data labels showing a percentage. 
For security purposes I've hidden the labels, but for the sake of explaining the example I will be referring to the values in the X axis as Column A and the data in the Y axis as Column B.
The graph is showing the values in Column A, and the sum of values in Column B associated with it make the X axis.
I have another column named Column C. This column is a calculated percentage that associates with the values in Column B, and I have set the average of this value to the Tooltip and the Data Label.

The issue I am running into is it seems whenever the average value in Column C is 0, instead of returning that percentage, I am getting back the sum of records from Column B.

You can see the clustered column chart below.

If there are any clarifying questions that need answered, please let me know.

Any and all help is greatly appreciated.

 

  • I was able to make a less than elegant solution. I was determining the percentage value off of a value zIsMade, which was binary, so I had a measure just grabbing the average as a percent.

    I threw this measure below together, and it is now functioning. I just have 1 decimal point and it is showing 0.0% when it should

    zPercentMeasure = if(SUM(Table[zIsMade]) = 0, 0.0000000000001, AVERAGE(Table[zIsMade]))

     

     
     

3 Replies

    • jarwest's avatar
      jarwest
      Helper II

      Hey amitchandak, I'm using a column driven label. I can change it to a measure if need be.

      zPercent = 

      CALCULATE(AVERAGE(Table[zIsMade]), GROUPBY(Table, Table[zColumnBKey]))
      EDIT
      I've made a new measure instead of a column thats 

      zPercentMeasure = AVERAGE(Table[zIsMade])
      but I am still getting the same error

  • I was able to make a less than elegant solution. I was determining the percentage value off of a value zIsMade, which was binary, so I had a measure just grabbing the average as a percent.

    I threw this measure below together, and it is now functioning. I just have 1 decimal point and it is showing 0.0% when it should

    zPercentMeasure = if(SUM(Table[zIsMade]) = 0, 0.0000000000001, AVERAGE(Table[zIsMade]))