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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Nemo17
Frequent Visitor

Group Time by another column and use in bar graph

I have calculated duration using start and end time. 

Nemo17_1-1677274386088.png

Now I want to create bar graph that has the total duration grouped by reasondescription. It should look like this.

Nemo17_2-1677274537321.png

Instead of count I want "Total duration" for that category.

I was able to create a measure for total time, but I am not able to use it in any graph. Except as tooltips.

 

Total Time = 
var a = SUMMARIZE(Table,groupbycolumn,"t",SUM(Table[Duration HH:MM:SS]))
return SUMX(a,[t])

 

Is there a way to get this done?

Thank you in advance!

1 ACCEPTED SOLUTION

is the attached sufficient ?  How exactly should the Y axis values be shown?

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

This is the sample data below.

Id

DTStartTimeDTEndTimeDuration HH:MM:SSReasonDescription
12/23/2023 12:002/23/2023 13:131:13:00A
22/23/2023 11:442/23/2023 12:000:16:00A
32/21/2023 18:002/21/2023 19:131:13:00B
42/21/2023 12:002/21/2023 13:001:00:00B
52/19/2023 7:452/19/2023 9:101:25:00D
62/19/2023 2:502/19/2023 5:002:10:00D
72/18/2023 17:512/18/2023 20:462:55:00F
82/18/2023 12:002/18/2023 13:071:07:00D
92/17/2023 6:302/17/2023 7:000:30:00F
102/16/2023 8:362/16/2023 9:220:46:00D
112/13/2023 12:002/13/2023 14:342:34:00B
122/13/2023 0:002/13/2023 12:0012:00:00G
132/12/2023 12:002/13/2023 0:0012:00:00G
142/12/2023 11:342/12/2023 12:000:26:00G
152/10/2023 7:182/10/2023 7:480:30:00D
162/10/2023 6:002/10/2023 6:420:42:00D
172/10/2023 0:002/10/2023 2:262:26:00E
182/9/2023 22:262/10/2023 0:001:34:00E
192/5/2023 0:002/5/2023 2:062:06:00B
202/4/2023 21:342/5/2023 0:002:26:00F
212/4/2023 8:112/4/2023 9:111:00:00D
222/2/2023 16:072/2/2023 23:026:55:00D
232/1/2023 12:002/1/2023 15:513:51:00B
242/1/2023 0:002/1/2023 12:0012:00:00G
251/31/2023 12:002/1/2023 0:0012:00:00G
261/31/2023 0:001/31/2023 12:0012:00:00G
271/30/2023 12:001/31/2023 0:0012:00:00G
281/30/2023 10:581/30/2023 12:001:02:00D
291/29/2023 1:291/29/2023 6:194:50:00E

And below is how I want the expected outcome to be. Group total time but Reason codes.

Nemo17_0-1677508883139.png

Let me know if you want anything else. Thank you helping out.

is the attached sufficient ?  How exactly should the Y axis values be shown?

I was trying to get hours and minutes format. 
But this will work as well, thanks a lot.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors