Show zero on months with not data "Stacked bar combo chart"

I using a “Stacked bar combo chart” and I have in the X-axis “Show date gaps” selected.
Is there a way to force the chart to go to zero on the months that I don’t have data, for example May, June and Octuber?

image

Hello Igor,

I think first you would need to replace the null or no data to 0 and then use that measure for the chart.

Please see this old post for some idea - How to display 0 when there is No Data. It currently displays "No Data: There was no data found for the visual

hope this helps.

Cheers,
Deep

I add ifelse to say if there’s no value show zero, bur I think the problem is that in those months I don’t have data. And looks like when there’s no data there’s no way to force to show zero.

I mean I don’t have row in the database base for those months!

Hello Igor,

Ah I see ! you do not have records for those months. Hence, the only way to show months is to show date gaps but it wont have any values or 0 on it. Thats why ifelse may not fly.

I think you may need to fix that at the backend or via custom Sql so as to included date value with 0 for no records.

Hope this gives some direction.
Cheers,
Deep

Hi @igfasouza

See this link. I guess currently you don’t have an elegant way to handle this via the visual.

However, if you bring in a calendar table in your dataset and do a left join (Calendar on Left) and your Fact table on the right side of join and then use the date from the Calendar table that would always show up in the visual whether you have data for the period or not.

You can do a test with a small dummy dataset and once confirmed apply on your dataset.

Doing a left join will be messy.
looks like a hack!

Hi @igfasouza,
It’s been awhile since last communication on this thread, did you have any additional questions regarding your post?

If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.

Thank you!

Hi @igfasouza,
Since we haven’t heard back, I’ll close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!