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
hlawrepbi
Frequent Visitor

Clustered Bar Chart Not Showing 0%

Hello, folks! 

While using the clustered bar chart visual, I have been unable to get data labels that are 0% to show. In the values field of the visual, I am using the DIVIDE function to generate the percentages, and I have the measure formatted to percent. I have tried multiple work-arounds, but have yet to succeed. I would gladly take any advice! Thank you!

 

The DAX I am using in my measure is as follows:

 
VAR Dollar_Sales_YA =
[Dollar Sales (Default 52 Wks)] - [Dollar Change YA]
VAR Ratio =
DIVIDE(
([Dollar Sales (Default 52 Wks)] - Dollar_Sales_YA),
Dollar_Sales_YA,
"0.0%"
)
VAR Alt_Result =
IF(
Ratio > 0,
Ratio,
"0.0%"
)
RETURN
Alt_Result
 
 
1 ACCEPTED SOLUTION

Hi, @hlawrepbi 

This has nothing to do with your  measure.

To avoid chart Not Showing 0%,you need to create a separate table for the field you apply to the axis  

Please try follow steps:

1. create a seperated table which only contains the axis field (location). 

 

 

Location table = DISTINCT('Table'[Location]) 

 

 

2.building relationships between your location table and original data table

('Table'[Location] <--->'Location Table'[Location] )

3.using the new field 'Location Table'[Location]  replace  the original axis field 'Table'[Location]

 

If I misunderstand your requirement or it doesn't work, please share a demo pbix file for testing. 

 

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

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@hlawrepbi , I do not see any diff in numerator or denominator.

the denominator should use removefilters to remove axis or legend column to get %.

 

Also, you can mark the column as % from measure tools and select decimal places. No need to format here

Data Format New Rib.png

 

Thanks for your reply @amitchandak! In this case, removefilters would remove some of the needed filter context that I need to perform the calculation, since the numbers vary by each location (which is the axis field). Just to be sure, I tried it out, but the entire chart was blank. 

 

Hi, @hlawrepbi 

This has nothing to do with your  measure.

To avoid chart Not Showing 0%,you need to create a separate table for the field you apply to the axis  

Please try follow steps:

1. create a seperated table which only contains the axis field (location). 

 

 

Location table = DISTINCT('Table'[Location]) 

 

 

2.building relationships between your location table and original data table

('Table'[Location] <--->'Location Table'[Location] )

3.using the new field 'Location Table'[Location]  replace  the original axis field 'Table'[Location]

 

If I misunderstand your requirement or it doesn't work, please share a demo pbix file for testing. 

 

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

 

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.