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
Blizzardstyx
Frequent Visitor

Utilization using Calendar function

Hi All,

 

I'm super close to solving my utilization problem per asset. I've come up with using a calendar function creating a seperate table to get the number of activities per day for the date range I'm interested in. I have figured out how to do it with one asset, now I'm trying to make it so I can have the sum of this solution for every asset. 

 

The core issue is that I'm trying to find out how many days of the month that a vehicle is utilized. I don't care about overlap, I don't care about number of activities, I just care if the asset was or was not used that day (of the month). In the file/picture below I'm halfway there, I just need the syntax to make my Tractors[Tractor ID] dynamic and to be placed on my Tractors table. 

 
 
 

Utilization problem.PNG

 

I have the file I'm working with right here:

https://drive.google.com/file/d/1Y42_E-gwZ7syAJ2_IBE_-u3Y6XE77okI/view?usp=sharing

 

@v-alq-msft Hoping you can help


Thanks in advance

1 ACCEPTED SOLUTION

Hi @Blizzardstyx ,

 

Pbix has been updated, please refer to this pbix again.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @Blizzardstyx ,

 

Regardless of the performance impact, you can create a calculated column with if or switch.

DaysUtilizedThisMonth_column.PNG

You can refer to the pbix.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @V-lianl-msft ,

 

The first tractor ID 1067 should show 9 days. (currently showing 😎

 

In the month of January it was utilized 1/1/2020-1/9/2020 over two activities. 

Hi @Blizzardstyx ,

 

Pbix has been updated, please refer to this pbix again.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

Could probably use GENERATE to generate a table that is the Cartesian product of your tractors and dates and then use ADDCOLUMNS to add your column on whether the tractor was ustilized on a particular day. Then it would be a matter of using SUMX or COUNTX and such to add those up versus all of the days in in the original calendar table.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.