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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
clteh9
Helper I
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:

clteh9_0-1669786668085.png

 

Expected result after adding estimated end time column:

clteh9_1-1669786716035.png

 

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

 

4 REPLIES 4
NikhilChenna
Skilled Sharer
Skilled Sharer

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)
Did I answer your question? Mark my post as a solution!

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?

clteh9_0-1669790527231.png

Thanks

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

hi nikhil, 

 

any idea of second question?  thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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