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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Running Total

I have a table with sales by month and year and wtih some months zero, I am trying to create a line chart that shows running total throughout the year, but the blank values are getting me and I can't see how to overcome this. 

 

I use this formula for the table and it works well, but can't see after reading all the posts on this topic how to close the gap on my problem 

 

SumSales = var sumsalesmonth =CALCULATE(SUM('Sales Data Structure'[INVOICED IN USD]))
return if(ISBLANK(sumsalesmonth),"0", sumsalesmonth 2019-08-30 16_04_04-Sales Performance - Latin America rev 2 - Power BI Desktop.png2019-08-30 16_03_45-Sales Performance - Latin America rev 2 - Power BI Desktop.png
6 REPLIES 6
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may check if the following post helps.

https://community.powerbi.com/t5/Desktop/Dax-Measure-Fill-Down-Value/m-p/594415#M282232

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

What result are you expecting?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I am looking for a total that adds up the prior months, but then also just repeats previous month until a value comes in.  

 

So that the line is continious 

Anonymous
Not applicable

I would use some of the time intelligent functions that DAX has, i.e. TOTALYTD. This should make your lines continuous.



Sales YTD = TOTALYTD( [Sales]; Date[Date]) // Returns the running total for the year
Anonymous
Not applicable

SumSalesYTD = TOTALYTD(sum('Sales Data Structure'[INVOICED IN USD]),DATESYTD('Date'[Date]))
 
This is the measure I use and it produces this result 
 
2019-09-04 09_29_13-Window.png
Anonymous
Not applicable

I cannot recreate the issue in my own workbook. But I have two suggestions which might work:

  • If you have not marked your date table as a date table, then try and do so. It can be done under the 'modeling' tab.
  • It is not necessary to have the last DATESYTD in your TOTALYTD formula because it is implicit in the formula.

As you can see in the picture below then when there are no observations in a given month then the line just stays horizontally in my workbook (which I believe is the functionality you are looking for?)

test.PNG

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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