Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
jarwest
Helper II
Helper II

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.

jarwest_0-1696622357047.png

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

Any and all help is greatly appreciated.

 

1 ACCEPTED SOLUTION
jarwest
Helper II
Helper II

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]))
jarwest_0-1696872992727.png

 

 
 

View solution in original post

3 REPLIES 3
jarwest
Helper II
Helper II

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]))
jarwest_0-1696872992727.png

 

 
 
amitchandak
Super User
Super User

@jarwest , Are you suing measure driven labels.

 

I think the calculation has some problems.

 

ca you share the meausre

 

Percent of Total and Percent of SubTotal https://www.youtube.com/watch?v=6jTildcV2ho
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=24270s

 

Power BI- Measure driven data labels| How to use a different measure on label| Some interesting visuals: https://www.youtube.com/watch?v=Y6G1Rj_O7XE

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.