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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mjmar025
Helper I
Helper I

Data Label Question

I have a bar chart with a date on the x-axis and a $ amount as the value. When I make a year selection in a slicer, several of the values in the bar chart go to zero. Is it possible to remove the data labels in the bar chart when the value is 0?

1 ACCEPTED SOLUTION
KHorseman
Community Champion
Community Champion

Rewrite your measure to use a variable and an IF statement to blank out zeroes. Assuming your measure is something like:

 

Sales = SUM(SalesTable[Amount])

...you would rewrite it as:

 

Sales = VAR result = SUM(SalesTable[Amount])
RETURN IF(result = 0, BLANK(), result)

This will turn zeroes into blanks, which do not show up in data labels.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @mjmar025,

 

Could you please mark the proper answer if it's convenient for you? That will be a help to others.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
KHorseman
Community Champion
Community Champion

Rewrite your measure to use a variable and an IF statement to blank out zeroes. Assuming your measure is something like:

 

Sales = SUM(SalesTable[Amount])

...you would rewrite it as:

 

Sales = VAR result = SUM(SalesTable[Amount])
RETURN IF(result = 0, BLANK(), result)

This will turn zeroes into blanks, which do not show up in data labels.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.