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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Hyperchef1969
Helper V
Helper V

Running total of full last 12 calendar months

Hi,

 

I want to calculate the running total of the full last 12 calender months. This for Late, on time and grand total.

 

Microsoft Excel - OTD MY KPI.png

 

Above the pivottable of the dataset within excel.

 

So for 2018-02 on time = 1509. For 2018-03 this should be 1509+1922 etc.

 

Next month, so when we are in March 2019, calculation should be based on months 2018-03 till 2019-02. I am working with a datetable so when I am able to calculate the date range this should be incorporated within the calculate count function I assume.

 

Thanks for help in advance!

 

 

 

 

1 ACCEPTED SOLUTION

Solved myself with following calculation (can be accepted as solution 🙂 )

 

Running_total_on_time_and_early = CALCULATE(COUNT(Purchasing_data[OTD 2d]),Purchasing_data[OTD 2d]="on time" || Purchasing_data[OTD 2d]="early",FILTER(ALLSELECTED(Date_table),Date_table[Date] <= MAX(Date_table[Date])))
 
 

View solution in original post

5 REPLIES 5
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Hyperchef1969 

 

You may try to create a measure like below:

Measure =
CALCULATE (
    SUM ( Table[On time] ),
    DATESINPERIOD ( 'Calendar'[Date], LASTDATE ( 'Calendar'[Date] ), -12, MONTH )
)

Regards,

Cherie

Community Support Team _ Cherie Chen
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 think you should use earlier function like that;

column = CALCULATE(SUM(table[on_time]);FILTER(table;table[On_time_delivery_month]<=EARLIER(table;table[On_time_delivery_month])))

If you share your dataset as text i would help you better.

Hi,

 

I implemented the running total of the total inbound shipments succesfully as by following calculation, but now I need to build extra filters for calculating the number of Early, Late, On time & Early+On time. These subcategories come from the field 'Purchasing_data[OTD 2d]. So the question is how to implement these extra filters in to the calculation I already have, so that I can create 4 extra measurements for running total in time, running total late, running total early and running total in time+early. Thanks for your help in advance.

 

Running_total_inbound = CALCULATE(COUNT(Purchasing_data[OTD 2d]),FILTER(ALLSELECTED(Date_table),Date_table[Date] <= MAX(Date_table[Date])))
 
OTD_Inbound_Rev2 (UC) - Power BI Desktop_2019-02-22_11-34-37.png

Solved myself with following calculation (can be accepted as solution 🙂 )

 

Running_total_on_time_and_early = CALCULATE(COUNT(Purchasing_data[OTD 2d]),Purchasing_data[OTD 2d]="on time" || Purchasing_data[OTD 2d]="early",FILTER(ALLSELECTED(Date_table),Date_table[Date] <= MAX(Date_table[Date])))
 
 

Hi @Hyperchef1969 

 

Got it, if you have resolved the issue, please mark your reply as answer to close this thread.

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.