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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Adding numbers for a date plus all numbers for the previous 6 days

I am having trouble creating a measure that adds the number in the Actual column for a particular day plus all of the Actual numbers for the previous 6 days.

SubcategoryDateActual Sum (Actual + Actual for Previous 6 days)
Operator Maintenance (PM02)6/1/202410  
Preventative Maintenance (PM02)6/1/20245  
Corrective Maintenance (PM01)6/1/20243  
Operator Maintenance (PM02)6/2/202444  
Unplanned Maintenance (PM03)6/2/202422  
Corrective Maintenance (PM01)6/2/202414  
Operator Maintenance (PM02)6/3/20242  
Preventative Maintenance (PM02)6/3/202420  
Unplanned Maintenance (PM03)6/3/202415  
Corrective Maintenance (PM01)6/3/20248  
Preventative Maintenance (PM02)6/4/202439  
Unplanned Maintenance (PM03)6/4/202412  
Corrective Maintenance (PM01)6/4/20242  
Preventative Maintenance (PM02)6/3/202416  
Unplanned Maintenance (PM03)6/3/202420  
Corrective Maintenance (PM01)6/3/202419  
Corrective Maintenance (PM01)6/4/202410  
Operator Maintenance (PM02)6/4/20244  
Preventative Maintenance (PM02)6/4/20243  
Unplanned Maintenance (PM03)6/4/20248  
Corrective Maintenance (PM01)6/5/202447  
Operator Maintenance (PM02)6/5/202419  
Preventative Maintenance (PM02)6/5/20242  
Unplanned Maintenance (PM03)6/5/20248  
Corrective Maintenance (PM01)6/5/202435  
Operator Maintenance (PM02)6/6/202415  
Preventative Maintenance (PM02)6/6/202416  
Unplanned Maintenance (PM03)6/6/202435  
Corrective Maintenance (PM01)6/6/20247  
Operator Maintenance (PM02)6/7/202445  
Preventative Maintenance (PM02)6/7/20242  
Unplanned Maintenance (PM03)6/7/20249  
Corrective Maintenance (PM01)6/7/20248  
Preventative Maintenance (PM02)6/8/20246  
Unplanned Maintenance (PM03)6/8/202413  
Corrective Maintenance (PM01)6/8/20248  
Operator Maintenance (PM02)6/9/202439  
Preventative Maintenance (PM02)6/9/20244  
Unplanned Maintenance (PM03)6/9/202413  
Corrective Maintenance (PM01)6/9/20245  
Corrective Maintenance (PM01)6/10/202412  
Operator Maintenance (PM02)6/10/202458  
Preventative Maintenance (PM02)6/10/202426  
Unplanned Maintenance (PM03)6/10/20242  
19 REPLIES 19
Anonymous
Not applicable

Hi @Anonymous 

 

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered to close this topic?

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I am still looking for help with the last part of the ask. 

lbendlin
Super User
Super User

You are including the last 6 days in April?

Anonymous
Not applicable

No. Would want to include only the figues for May. 

That's not what the data says

 

lbendlin_0-1718652776730.png

 

Anonymous
Not applicable

Are you still willing to help with this?

Anonymous
Not applicable

Hi,

Are you still able to help with the total sum for seven days for a month? I understand that it doesn't follow the logic previously dicussed. I just need a measure that sums all of the seven days figures for May.<please> 

Anonymous
Not applicable

I understand the monthly total of seven days doesn't align with the logic of the seven days measure. The requestor is aware of that. 

Anonymous
Not applicable

Hi,

The expected result for the month of May is a total sum of the seven days figures for all of May. See data:

DateActual seven days % Emergency 
5/1/2024  127    
5/2/2024  105    
5/3/2024  105    
5/4/2024  105    
5/5/2024  105    
5/6/2024  105    
5/7/202414 14    
5/8/202443 57 11%  
5/9/202416 73 10%  
5/10/202463 136 7%  
5/11/202490 226 6%  
5/12/202464 290 4%  
5/13/202484 374 1%  
5/14/202416 376 1%  
5/15/2024  333    
5/16/2024  317    
5/17/2024  254    
5/18/2024  164    
5/19/2024  100    
5/20/202426 42 0%  
5/21/2024  26    
5/22/20248 34 21%  
5/23/2024  34    
5/24/2024  34    
5/25/2024  34    
5/26/2024  34    
5/27/202431 39 0%  
5/28/2024  39    
5/29/202416 47 6%  
5/30/2024  47    
5/31/2024  47    
Total  3823<---------------------------------Expected Result

 

Anonymous
Not applicable

Thank you. The Seven days measure works perfectly.  % Emergency is a measure that I created with the use of "seven days" as a denominator.  When I delete "Date" from the report to summarize the % Emergency by month, I get an Infinity error as seven days becomes 0 in the report.  How to create a separate seven days measure that will work for my monthly figures? 

You cannot measure a measure directly. Either materialize it first, or create a separate measure that implements the entire business logic.

 

Weeks and months are incompatible.

Anonymous
Not applicable

Is there a measure I can use that has the months and days logic? OR 

 

Is there a separate months measure that I can use? I appreciate your help. 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Anonymous
Not applicable

Here is my sample data:

DateActualseven days
5/10/2024963
5/11/202413153
5/12/202413217
5/13/20242282

 

Here is the by date outcome which is working perfectly.

gmarie_0-1718288156635.png

Here is what I need by month:

gmarie_1-1718288212888.png

 

The seven days figure isn't calculating by month as the seven days measure doesn't calculate for the month. 

 

 

Anonymous
Not applicable

Now, I see how this would be weird by month. I'll need to get clarification from the requester. This may take a few days. Thank you SO much for your help. 

What is your expected outcome?

lbendlin
Super User
Super User

The last six calendar days or the last six days with data? What should happen for days without data?

 

lbendlin_0-1718198571728.png

 

Anonymous
Not applicable

Hi, 

The last 6 calendar days.

lbendlin_0-1718202560782.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.