cancel
Showing results 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.

Helper I

## Calculate estimated end time based on the median of turn around time

Hi,

I would like to add one more column to indicate  the estimated end time for item#6 an item#7.

Estimated end time = start time + median of turn around time per category

Table:

Expected result after adding estimated end time column:

Any help or discussion on this problem would be highly appreciated. Thanks

4 REPLIES 4
Continued Contributor

Hi @clteh9 , By using below measures you'll be able to acheive the solution from the below,

1.

Median of turn around time per category =

VAR currentCategory =

MAX ( 'Table1'[Category] )

RETURN

MEDIANX (

FILTER ( ALL ( 'Table1' ), 'Table1'[Category] = currentCategory),

DATEDIFF ( 'Table1'[Start Time], 'Table1'[End Time], HOUR )

)

2. After you get the median you can now create a calculated column,

Estimated end time

'Table1'[start time]+'table1'[Median of turn around time per category]

Regards,

Nikhil Chenna

Appreciate with a Kudos!! (Click the Thumbs Up Button)

Helper I

Hi Nikhil,

Thanks for the prompt response.

1. why use MAX to get the current category?

VAR currentCategory =

MAX ( 'Table1'[Category] )

2. Hit the following error. Can advise?

Thanks

Continued Contributor

Hi @clteh9 ,

I used max because while declaring the variable you can directly call a column you have to use some function.

Regards,

Nikhil Chenna

Helper I

hi nikhil,

any idea of second question?  thanks

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors