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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
lamlamm24
Helper I
Helper I

Calculating Hourly Supply

This is what my table looks like before filtering by any person to see how many hours they worked. 

 

After filtering by a person that worked from 12am to 8am on a particular date, lets say 02/11/2024 here is what I have 

((Total of 8hrs in the  12AM Column).

 

 

The challenge I have is that I want the entire 8 hours to be spread across from 12am to 8am something like this. i created this in word for better illustration

lamlamm24_2-1709866637707.png

 

 

 

2 REPLIES 2
v-zhouwen-msft
Community Support
Community Support

Hi lbendlin ,thanks for the quick reply.

Hi lamlamm24 ,

Please follow these steps:
1. Use the following DAX expression to create a table

Table  = GENERATESERIES(TIME(1,0,0),TIME(8,0,0),TIME(1,0,0))

2. Use the following DAX expression to create a column(‘HourSupply’: Sum of hours worked after filtering with clinicians on specific dates, I'm assuming a figure of 8.)

Column = DIVIDE([HourSupply] ,8)

3.Use the following DAX expression to create a column

Column2 = SWITCH(TRUE(),
[Value] = TIME(1,0,0),"12am-12:59am",
[Value] = TIME(2,0,0),"1am-1:59am",
[Value] = TIME(3,0,0),"2am-2:59am",
[Value] = TIME(4,0,0),"3am-3:59am",
[Value] = TIME(5,0,0),"4am-4:59am",
[Value] = TIME(6,0,0),"5am-5:59am",
[Value] = TIME(7,0,0),"6am-6:59am",
[Value] = TIME(8,0,0),"7am-7:59am"
)

4.Final output

vzhouwenmsft_0-1712050341662.png

 

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.