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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Tremor1981
Frequent Visitor

Count Number of Days an Equipment is at a location.

Hello - I've tried to come up with a dax that will count the number of days an equipment is at a location. I've included a data sample below: The end goal would be to have: Resource Description, Location, Date Range and number of days.

 

Tremor1981_0-1677102985089.png

 

 

 

 

 

 

6 REPLIES 6
uzeq
Advocate I
Advocate I

I don't know if my solution is very efficient. Here's what I did in the same situation in the Power Query Editor: I made a custom column with this formula:
Duration.Days([Date Finished] - [Date Started])+1

 

In my situation, I added a +1 because my equipment being the same place logging as 0 days was causing a nuisance.

I think that would work if the Start date/Finish date was align but in this case the finished date is only showed when the equipment piece is moved(see spreadsheet)

You can also add conditional column - if empty, use the Today function. If populated, use what is in there.

https://learn.microsoft.com/en-us/dax/today-function-dax

 

Then use that for your duration calculation.

Again - not sure if this is the most efficient solution but it has worked for me.

I don't understand

From what I understand, your finish date is either empty or not populated. If you have a finish date, you can use power query to add a custom column to count the days, using Duration.Days.

 

Since you have gaps, you could make an additional column. If you have a finish date, pull that in. Otherwise, use the current date in your new column. Use this new column for the subtraction mentioned above. This would give you an ongoing count of duration for the equipment.  

I see. I didnt explain fully. So each row represents a equipment move. the column finish date is worthless(it's how the systems works right now). The move from column and move to column lets me know that a equipment peices was moved. So you'll have to take the difference of the start dates. see below

 

Tremor1981_0-1677109021530.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.