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
NoobPowerUser
New Member

How to calculate a running total of available cars in fleet looking 14 days forward?

I am trying to create a table view that will calculate the running empty cars available along with subtracting the target load daily for 14 day period starting Today based on Fleet, Sub Fleet and Origin catagory. I have the following dashboard built but the numbers are off.

 

Objective is to get the total of all empty cars for TODAY (first row) then based on the ETA calculate the sum of cars flagged as 'L' and 'E' for the remaining 13 out of 14 days. The Cars Available column should calculate starting next day fourmula as

 

Cars Available = Empty Cars (Previous Day) + Empty Car (current) - Car Loaded 

 

Car loaded will be static field (always)

 

EXAMPLE OUTPUT:
NewExample.jpg

 

Current power bi dashboard I have tired to built.


Please ignore the Cars Ready column this is a test column which isnt working.

Measures of the Loaded Cars: 

 
Loaded Cars = IF(
    FIRSTDATE('Fleet Daily Status'[ETA])<=TODAY(),
    COUNTROWS(FILTER('Fleet Daily Status','Fleet Daily Status'[Load Empty]="L"&&'Fleet Daily Status'[ETA]<=TODAY())),
    COUNTROWS(FILTER('Fleet Daily Status','Fleet Daily Status'[Load Empty]="L"))
    )
Empty Cars = IF(
    FIRSTDATE('Fleet Daily Status'[ETA])<=TODAY(),
    COUNTROWS(FILTER('Fleet Daily Status','Fleet Daily Status'[Load Empty]="E"&&'Fleet Daily Status'[ETA]<=TODAY())),
    COUNTROWS(FILTER('Fleet Daily Status','Fleet Daily Status'[Load Empty]="E"))
    )

Cars Available
= CALCULATE([Empty Cars] - 'Target Load Car'[Target Load Car Value],FILTER('14 Day Forecast',MAX('14 Day Forecast'[Date] )))

NoobPowerUser_0-1670972965683.png

Data Fields

NoobPowerUser_1-1670973434170.png

 

2 REPLIES 2
NoobPowerUser
New Member

Please see the linked file below with raw data and results under tab 'Output Results'. 

 

Fleet Data 

 

Goal is to measure how many days of car inventory are avaibale to load before running to zero. 

v-binbinyu-msft
Community Support
Community Support

Hi @NoobPowerUser ,

In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_Binbin Yu

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.