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
Anonymous
Not applicable

time (in hours) per student - please advise

How do I make a visualization where Times duration is in hours instead of a text string?   help hours per employee.PNG
I need it to be an integer so I can total the hours for each Student.

 

Desired result looks like...

Blake: 2

Christianson: 4

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create a table to test:

71.png

Please take following steps:

1)Use ‘Split Column’ function in Query Editor:

72.png73.png

And it shows:

74.png

2)Then, add a custom column:

75.png

3)After Close&Apply, transfer column [TimeDuration] format to ‘Decimal number’:

76.png

4)Create a measure to calculate each student’s time duration:

TimeDuration of each student = CALCULATE(SUM('Table'[TimeDuration]),ALLEXCEPT('Table','Table'[Student Name]))

5)The result shows:

77.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create a table to test:

71.png

Please take following steps:

1)Use ‘Split Column’ function in Query Editor:

72.png73.png

And it shows:

74.png

2)Then, add a custom column:

75.png

3)After Close&Apply, transfer column [TimeDuration] format to ‘Decimal number’:

76.png

4)Create a measure to calculate each student’s time duration:

TimeDuration of each student = CALCULATE(SUM('Table'[TimeDuration]),ALLEXCEPT('Table','Table'[Student Name]))

5)The result shows:

77.png

Here is my test pbix file:

pbix 

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

Hello Giotto,

 

Thank you for your time and effort. Great explanation, it helped!

CoreyP
Solution Sage
Solution Sage

I would open Query Editor, select your Times column and split by delimiter of " - ".

 

Rename the columns to start time and end time, respectively.

 

Then add a new column subtracting end time from start time.

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.