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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
CookieMonster
Helper I
Helper I

Stacked Area Chart with Cumulative Cost - Straight line when no values

Hi,

I have the following Stacked Area Chart

CookieMonster_0-1630588311899.png

What I am trying to work out, is how I can make it do a straight line across, when no further data exists for that legend item, or if data is missing for that legend item on a particular date.

This is the measure I currently have to work out the cumulative cost:

 

CumulativeCost = 
CALCULATE (
    SUM ( 'Usage details'[costInBillingCurrency] ),
    FILTER (
        ALL ( 'Usage details'[date] ),
        'Usage details'[date] <= MAX ( 'Usage details'[date] )
    )
)

 

I hope my question makes sense and someone can help.

 

5 REPLIES 5
parry2k
Super User
Super User

@CookieMonster why do you expect it to start at 0 if there is data on August 01st?



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.

parry2k
Super User
Super User

@CookieMonster change this too

 

CumulativeCost = 
CALCULATE (
    SUM ( 'Usage details'[costInBillingCurrency] ),
    FILTER (
        ALL ( 'Date'[Date] ),
        'Date'[Date] <= MAX ( 'Date'[Date] )
    )
)

 

if you read my post, one step is to mark this table as a calendar table, and seems like you missed that.

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to 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.

Yes I did sorry,

I have changed it to a Date Table now, but now the lines on the graph do not start at £0.

CookieMonster_0-1630653796548.png

 

Is this being caused by the DAX formular do you think?

parry2k
Super User
Super User

@CookieMonster you should add a calendar dimension in your model, you can following my blog post here to add one. Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutio...

 

Once that table is added, change your measure to use date from this new calendar table and also on x-axis use date from this new table and that will do it.

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to 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.

I have just tried this and it has left me with this:

CookieMonster_0-1630595057548.png

 

So it no longer looks to be cumculative, any ideas where I went wrong?

My measure is now: 

CumulativeCost = 
CALCULATE (
    SUM ( 'Usage details'[costInBillingCurrency] ),
    FILTER (
        ALL ( 'Date'[Date].[Date] ),
        'Date'[Date].[Date] <= MAX ( 'Date'[Date] )
    )
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.