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

Show Stats between hours completed

Hello

 

I currently have some data that each row contains a specific taskID number, there is a task Start and and Task complete column, and finally there is a tasklength column that shows how long the task took to run from start to end in Seconds, Hours Minutes and Days.

 

Essentially what i wish to do is find out how many tasks were completed less than 24 hours, between 24 and 48 hours and more than 48 hours by means of a bar graph

 

I cannot get my head around using a measure for greater than or less than etc

 

Any advice would be welcome

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Barrie2020,

You can create 3 measures for calculating the count of this different task length type:

 

tasklength<24 = CALCULATE(count('Task'[Task ID]),'Task'[TurnaroundTime(Hrs)]<24)
24<=tasklength<=48 = CALCULATE(count('Task'[Task ID]),'Task'[TurnaroundTime(Hrs)]>=24&&'Task'[TurnaroundTime(Hrs)]<=48)
tasklength<24 = CALCULATE(count('Task'[Task ID]),'Task'[TurnaroundTime(Hrs)]<24)

 

Show Stats between hours completed.JPG

Best Regards

Rena

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

you can create a column like

 

Duration in hr =datediff([ task Start] ,[Task complete ],HOUR)

 

On top of that build bucket using the switch

 

switch( true(),

[Duration in hr] <=24 , " < 24 ",

[Duration in hr] >=24 && [Duration in hr] <=48 ," 24 to 48 "

" > 48 "

)

 

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

Hi

 

Many thanks for your quick response

 

If it helps i already have a column that shows the time in hours, ee preview below

 

How can i create a bucket from this, i have not done switch buckets before, apologies

 

duration.JPG

Anonymous
Not applicable

Hi @Barrie2020,

You can create 3 measures for calculating the count of this different task length type:

 

tasklength<24 = CALCULATE(count('Task'[Task ID]),'Task'[TurnaroundTime(Hrs)]<24)
24<=tasklength<=48 = CALCULATE(count('Task'[Task ID]),'Task'[TurnaroundTime(Hrs)]>=24&&'Task'[TurnaroundTime(Hrs)]<=48)
tasklength<24 = CALCULATE(count('Task'[Task ID]),'Task'[TurnaroundTime(Hrs)]<24)

 

Show Stats between hours completed.JPG

Best Regards

Rena

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.