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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

4 REPLIES 4
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 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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