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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Running Total by OrderFactTable

I have a OrderFactTable that has an OrderDate.  I need to calculate a RunningTotal on a Patient Level for 45 days when a certain trigger happens on that patient.  In this instance the Trigger would be when it has been over 90 days since their previous order.  

 

 

So their is an OrderFact linked to a DateDim and a PatientDim.  I need a running total on a Numeric column 'TotalMME' for 45 days after the Date the Patient has had their first Order in atleast 90 day.

 

Thanks

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , You can get running total like

 

calculate(Sum(OrderFact[TotalMME]), filter(all(Date), Date[Date] <= max(Date[Date]) ) )

 

or

 

calculate(Sum(OrderFact[TotalMME]), filter(allselected(Date), Date[Date] <= max(Date[Date]) ) )

 

Not clear on 45 and 90 logic

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Here is the .pbix  sample 

Anonymous
Not applicable

Hi @amitchandak , any thoughts on the sample .pbix i posted?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors