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
brokencornets
Helper IV
Helper IV

Stacked area showing zeros

Hi guys, I'm being driven insane trying to do what I thought should be a very simple task.

I have an area graph showing jobs outstanding by priority over a period of time:

 1.PNG

But as you can see on the image, the lines above the areas don't drop down to zero when there are no outstanding jobs of that type for that month (this is calculated using a measure).

 

Adding '+0' the the end of the measure almost gets me there, however it then shows zeros all the way through to the end of 2020 (and from the start of 2018 if I start my data from October 2018), even though my date table only goes to TODAY():

2.PNG

How do I get the chart to stop at the current month without hard-coding it in every month?

22 REPLIES 22
v-eachen-msft
Community Support
Community Support

Hi @brokencornets ,

 

You could add an IF() formula in your measure.

IF (
    SELECTEDVALUE ( 'Date'[Date] ) <= TODAY (),
    [Measure]+0
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

I couldn't work out how to build this inside the measure itself, but I created a new measure:

O2= IF (
    SELECTEDVALUE ( 'Date'[Date] ) <= TODAY (),
    [Outstanding]+0
)

 but the results don't change unfortunately.

amitchandak
Super User
Super User

@brokencornets , check you Axis type, try to make continuous from categorical

Without adding 0.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit. The axis is already set to continuous, thanks for the suggestion though!

@brokencornets yes it should be on date table and it should work, can you share the pbix file with sample data and remove any sensitive information before sharing. 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Really difficult to do because of the nature of the data, but if all else fails I might have to give this a try using some dummy data.

@brokencornets help us to get help. If it is difficult for you, not sure how we can help.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

 

@brokencornets seems like that is a report published on your power bi instance, why not sure pbix file using one drive/google drive or simply send it by email, my email is in the signature. Just a reminder, remove any sensitive information before sharing.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

E-mailed you now, thanks 🙂

@brokencornets solution is already emailed back to you. you have to mark your date table as a date table to make it work which was missing.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

You're a star, thanks - could you maybe could talk me through exactly what I need to change, as when I try to open your solution I get an error stating 'Object reference not set to an instance of an object'?

@brokencornets mark date dimension as a date table, select date table, on table tools you will see the option Mark as a date table.

 

Not sure why you cannot open the pbix file, are you June 2020 release.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Ahh okay, I see it now. That's fixed the issue with the x-axis, but I don't seem to be able to show any level of granularity other than daily now - the date heirarchy disappears. I ideally want to be able to plot monthly, with the ability to drill into daily if required, and that functionality has now gone.

 

Sorry to be a pain! I really do massively appreciate your help!

@brokencornets yes, it will disappear which is fine, and you can create your own custom hierarchy and in my pbix that is what I did. There are tons of posts on how to create your own hierarchy and here is the link to one such post

 

https://stoneridgesoftware.com/creating-hierarchies-in-power-bi/

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi. Back to be a pain in the bum again.

 

I've tried creating my own heirarchies and I've also been able on access your solution on my laptop - but while this approach seems to fix the original problem, it creates others. When I filter down to Month, the months appear to be sorted alphabetically, and also it's not possible to change the access from categorical to continuous, which makes the axis look less pretty, especially on the size of chart I'm looking at (there'll be around 9 of these to a page).

 

Does anyone else have any other ideas, or do I have to go down the laborious route of updating the end date of the charts every month?

 

 

@brokencornets look at my blog post on how to correctly sort the months


https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Looks really useful, I've bookmarked the website for future. However, it doesn't (as far as I can tell) solve the issue of not being about to show the x-axis as continuous, which (given the size of my visualizations) means if I have more than 14 months of data the user will have to scroll left or right to see all the data, which is a bit of a deal-breaker.

@brokencornets once you drill down to the date level, you will able to change x-axis type to category and it will work. Let's be very clear here, change the table as a date table wouldn't have an impact on the visualization, you can still achieve the same, it is matter of doing it the right way.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks, much appreciated!

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.