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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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