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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Running Total - Count Groups with Missing Values

I'm trying to create a running total for the number of open data sets our department has published by month, so that we can see how many data sets each division has published through any given month. There are months where only one division published an open data set, and months where no data sets were published at all. Here's my data: 

 

OD_Data_Screenshot.PNG

What I ultimately want is a simple graph like this:

 

OD_aspiration_Screenshot.PNG

 

 

But using this formula:

 

OD_formula_Screenshot.PNG

 

I get this instead: In a matrix & a bar graph. 

 

OD_current_Screenshot.PNG

 

I think what I need is for the matrix values to fill in the prior value when there is no new data, instead of returning a blank. I can't for the life of me figure out how to do this. 

 

So in summary, I'm looking to:

  • Create a running count of rows
  • Where months that have missing data are still pulling the totals from prior months
  • And where each month is stacking / categorizing my values by group = division. 

 

Any help would be much appreciated!

1 ACCEPTED SOLUTION
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

Firstly, create a date table in Power BI Desktop following the guide in this blog.

Secondly, create relationship using date field of the date table and pub_date field of Open Data table.

Thirdly, create measure using DAX below.

Running OD = CALCULATE(COUNT('Open Data'[ds_name]),FILTER(ALL('Date'),'Date'[DateKey]<=MAX('Date'[DateKey])))


At last, drag date field of date table to X-Axis of your chart.
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
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-yuezhe-msft
Microsoft Employee
Microsoft Employee

@Anonymous,

Firstly, create a date table in Power BI Desktop following the guide in this blog.

Secondly, create relationship using date field of the date table and pub_date field of Open Data table.

Thirdly, create measure using DAX below.

Running OD = CALCULATE(COUNT('Open Data'[ds_name]),FILTER(ALL('Date'),'Date'[DateKey]<=MAX('Date'[DateKey])))


At last, drag date field of date table to X-Axis of your chart.
1.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

how to stop the running sum on the last date? 

Thanks.

Anonymous
Not applicable

I have the same issue on how to stop the running sum on the last date of data. Is it possible ?

Anonymous
Not applicable

@v-yuezhe-msft

 

Your solution was so helpful! See below for the viz I was able to create. As you can see I've made a combination bar & line chart. I just have one more question:

 

How can I get the bars to stop appearing after today's date, while the line continues? I want to be able to see the goal into future months without seeing the actual progress made. Is there a way to apply the "Today()" function to the running total calculation, so that the calculation only shows the running total up to today's date, and doesn't project out into the future?

 

OD_line and bar.PNG

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.