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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Edgard
New Member

Visualize Actual and Available Daily Working Hours of a Team with Empty Days

Hello Community,

 

I have a dataset of Workers activities in the following format:

 

Activity IDDateTime StartDateTime EndUser
110/09/2019 12:51:0612/09/2019 15:51:25USER1
211/09/2019 10:21:5913/09/2019 17:01:12USER2

 

With a script I have made a new table wich counts the daily working hours for each date and user (for example, from 7am to 6pm), wich would end like this for the previous example:

 

DateActivity IDUserHours
10/09/20191USER15
11/09/20191USER110
11/09/20192

USER2

7.5
12/09/20191USER12
12/09/20192USER210
13/09/20192USER21

 

Now, here are the problems I'm facing:

1. I need to display Total Working Hours vs Date, but I need to also show the days when no activity was registered. I partially managed to do this by creating a calendar, but when I use a slicer to filter the dates from (for example) day 1 to 5, if day 1 or day 5 doesn't have registered activities, they don't show. Any other day in between is shown in the Bar Graph even with no activity registered.

2. I have a meter with Actual Working Hours (SUM of worked hours in the days) and Available Working Hours (# of working days * # of users * 10), but then again, it's not calculating the days with no activities for the Available Working Hours. I'm calculating this with a measure 

 

 

Available Hours = CALCULATE(DISTINCTCOUNT('Users'[User Alias]))*10*CALCULATE(DISTINCTCOUNT(Calendar[Date]),Calendar[Day]<6)

 

 

 

I hope you can help me, please tell me if I need to clarify anything in my question.

 

Thanks.

1 ACCEPTED SOLUTION

Thanks for the suggestion of using another calendar. It help me to notice that the problem was the bilateral correlation. So the solution was actualy to change the Relationship from Both to Single.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

As the calendar is joined with your table having working day data, it might not be giving all day.

 

Create on more calendar tables and join it with the calendar table. Here you can also add working hours.

You can try something like this to get active users in this new table. But this work with the joined the tables.  To populate back the active users on that day.

Example code. to be created as a column

Max Sales order id = Maxx(filter(sales,Sales[item_id]='Item'[Item ID]),Sales[Order Id]) 

 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks for the suggestion of using another calendar. It help me to notice that the problem was the bilateral correlation. So the solution was actualy to change the Relationship from Both to Single.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.