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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Kavya123
Helper III
Helper III

Show zero values in bar chart

Hi All,

 

I want to show zero values in bar chart. Please find the sample data and the screenshot.

Answer text field is dimension and sector field is filter in the report..

Below is the measure I am using in Bar chart :  

New Measure =
var v1=
CALCULATE(DISTINCTCOUNT( AnswerHistory_Benchmarking[POrganization]) , FILTER(AnswerHistory_Benchmarking, AnswerHistory_Benchmarking[POrganization] <> 6377) ))
return
if(ISBLANK(v1),0,v1).
 
If I select Asset and wealth Management in sector filter then all the answet texts should display in the y axis. 
For ex: Answer text DDD doesn't contain Asset and wealth Management still it should display in Y axis and represent as zero.
SAMPLE DATA.PNG
Below screenshot is my expected output.

Capture.PNG


Thanks in advance

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Kavya123 ,

 

Create a sector table, then create a relationship with the fact table and use it as axis.

Table 2 = DISTINCT('Table'[Sector])

Vlianlmsft_1-1635921813470.png

 

Vlianlmsft_0-1635921783698.png

 

 

Best Regards,
Liang
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

7 REPLIES 7
V-lianl-msft
Community Support
Community Support

Hi @Kavya123 ,

 

Create a sector table, then create a relationship with the fact table and use it as axis.

Table 2 = DISTINCT('Table'[Sector])

Vlianlmsft_1-1635921813470.png

 

Vlianlmsft_0-1635921783698.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @V-lianl-msft ,

Im looking for similar kind of requirement above. Tha bar chart should display "0" even  if we dont have blank values in fields instead of fields missing when filter. I am aware of "show items with no data". This is something which i can see categories on y-axis with not displaying "0". Im looking for categories should display "0" when we filter on  other columns.

 

Expected Output:

kkanukurthi_0-1729493198300.png

 

Thanks in advance,

KK

That's a bad UX. Have your users asked for that?

Yes @lbendlin since i hide x-axis values and enable data labels users want to see '0' display for categories which have no data on bar chart. 

Another request please, can we lock slicer drop down list on top screen instead of using scroll bars down the way to check category. It is occupying more space overlapping with other visuals.

 

Thanks in advance

KK

Hi Kavia,

There is a simpeler solution to your problem.

When you create a measure for the number of students, for instance:

NumberOfStudents = COUNT(SP_DASHBOARD[STUDENTNUMBER])

, the 0-values are not shown in the charts.

 

When you create the measure like this:

NumberOfStudents = IF(COUNT(SP_DASHBOARD[STUDENTNUMBER])=0, 0, COUNT(SP_DASHBOARD[STUDENTNUMBER]))
, the 0-values are shown in the charts.

@AllardBon   I would consider that to be a bug - as it means that BLANK() is treated as being equal to 0 which is incorrect.

lbendlin
Super User
Super User

Usually you can achieve that by using fields from the dimension table and selecting "show items with no data"

 

Please show a sanitized version of your data model.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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