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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Robot123
Frequent Visitor

Mean, median and percentile

Hi everyone,

I am new to PBI and need help.

My team receives service requests and completes them.  While working on the requests, we may reach out to some other departments.  Each time we reach out, we record the leadtime the department takes to come back.

By country and month, I would like to find out the following:

what are the mean and median distinct count of requests that we needed to reach out to other departments?
what are the mean and median count we reached out to other departments per request?
what are the mean and median response time (sum of dept_leadtime in request) per department?
What are the mean and median response time (sum of dept_leadtime in request) per department at 90percentile of response time?

Honestly, am not clear if I am making sense...

Hope you can help me.

Thank you.

Request IDCountryClosed dateDeptDept_Leadtime (Hr)
8409950NZ04-Jul-23OP0.011388889
8409950NZ04-Jul-23OP0.941944444
8409950NZ04-Jul-23OP0.123333333
8409950NZ04-Jul-23OP0.088333333
8461598AUS19-Sep-23OP0.323611111
8461598AUS19-Sep-23OP0.16
8461598AUS19-Sep-23SR24.75972222
8461598AUS19-Sep-23OP0.139722222
8461598AUS19-Sep-23OP0.002222222
8461598AUS19-Sep-23SR0.053888889
8461598AUS19-Sep-23OP0.787222222
8461598AUS19-Sep-23OP0.005277778
8461598AUS19-Sep-23SR32.42527778
8461598AUS19-Sep-23OP0
8461598AUS19-Sep-23OP0
8461598AUS19-Sep-23SR0
8461598AUS19-Sep-23OP28.22472222
8461598AUS19-Sep-23OP0
8461598AUS19-Sep-23OP0
8461598AUS19-Sep-23SR14.64888889
8461598AUS19-Sep-23OP0.503333333
8461598AUS19-Sep-23OP0.005555556
8461598AUS19-Sep-23SR0.842222222
8461598AUS19-Sep-23OP32
8461598AUS19-Sep-23OP0.0125
8461598AUS19-Sep-23SR17.41555556
8461598AUS19-Sep-23OP0.391666667
8461598AUS19-Sep-23OP0.167222222
8461598AUS19-Sep-23SR19.51944444
8461598AUS19-Sep-23OP0
8461598AUS19-Sep-23SR15.8025
8461598AUS19-Sep-23OP0.076388889
8461598AUS19-Sep-23OP0.042222222
8461598AUS19-Sep-23SR0.078888889
8461598AUS19-Sep-23OP0.660833333
8461598AUS19-Sep-23OP0.131388889
8461598AUS19-Sep-23OP0.039722222
8461598AUS19-Sep-23SR16.51888889
8461598AUS19-Sep-23OP2.514722222
8461598AUS19-Sep-23OP0.0025
8461598AUS19-Sep-23SR0.133888889
8461598AUS19-Sep-23OP2.2875
8461598AUS19-Sep-23OP0.003611111
8461598AUS19-Sep-23OP0.080277778
8461598AUS19-Sep-23OP26.65527778
8461598AUS19-Sep-23OP22.01805556
8461598AUS19-Sep-23OP0.263611111
8461598AUS19-Sep-23OP0.0125
8461598AUS19-Sep-23SR19.75416667
8461598AUS19-Sep-23OP0.009722222
8461598AUS19-Sep-23SR4.6875
8461598AUS19-Sep-23OP0.130555556
8461598AUS19-Sep-23SR13.47416667
8461598AUS19-Sep-23OP17.17722222
8461598AUS19-Sep-23OP0.2375
8461598AUS19-Sep-23OP0.005277778
8461598AUS19-Sep-23SR12.14694444
8461598AUS19-Sep-23OP0.006666667
8461598AUS19-Sep-23SR14.88722222
8461598AUS19-Sep-23OP0.478055556
8461598AUS19-Sep-23OP0.211944444
8461598AUS19-Sep-23SR15.51666667
8552256AUS07-Sep-23OP0
8552256AUS07-Sep-23OP0
8552256AUS07-Sep-23SR0
8552256AUS07-Sep-23OP4.355
8552256AUS07-Sep-23OP0.003888889
8552256AUS07-Sep-23OP1.236388889
8552256AUS07-Sep-23OP0.208333333
8552256AUS07-Sep-23OP0.003055556
8552256AUS07-Sep-23SR42.75805556
8552256AUS07-Sep-23OP0.041388889
8552256AUS07-Sep-23OP0.134444444
8552256AUS07-Sep-23SR16.55805556
8552256AUS07-Sep-23OP2.658055556
8552256AUS07-Sep-23OP0.003055556
8552256AUS07-Sep-23SR4.271111111
8552256AUS07-Sep-23OP0.003333333
8552256AUS07-Sep-23SR1.064444444
8552256AUS07-Sep-23OP0
8552256AUS07-Sep-23SR3.644722222
8552256AUS07-Sep-23OP0.036388889
8552256AUS07-Sep-23OP0.011111111
8552256AUS07-Sep-23SR0.488055556
8552256AUS07-Sep-23OP0.0175
8552256AUS07-Sep-23OP0.061944444
8552256AUS07-Sep-23SR51.74027778
8559805AUS08-Sep-23OP0
8559805AUS08-Sep-23OP0
8559805AUS08-Sep-23SR12.23694444
8559805AUS08-Sep-23OP0.038888889
8559805AUS08-Sep-23OP0.032777778
8559805AUS08-Sep-23OP1.681666667
8559805AUS08-Sep-23OP0.106666667
8559805AUS08-Sep-23OP0.009722222
8559805AUS08-Sep-23SR6.251666667
8559805AUS08-Sep-23OP1.505833333
8559805AUS08-Sep-23OP0.003055556
8559805AUS08-Sep-23SR21.57055556
8559805AUS08-Sep-23OP0
8559805AUS08-Sep-23OP0
8559805AUS08-Sep-23SR8
8559805AUS08-Sep-23OP2.788611111
8559805AUS08-Sep-23OP0.004722222
8559805AUS08-Sep-23SR1.674722222
8559805AUS08-Sep-23OP0.01
8559805AUS08-Sep-23OP0.055
8559805AUS08-Sep-23OP0.002777778
8559805AUS08-Sep-23SR19.02055556
8559805AUS08-Sep-23OP0.087777778
8559805AUS08-Sep-23OP0.024166667
8559805AUS08-Sep-23SR48.33166667
8409950NZ04-Jul-23OP0.011388889
8409950NZ04-Jul-23OP0.941944444
8409950NZ04-Jul-23OP0.123333333
8409950NZ04-Jul-23OP0.088333333

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Robot123 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures. 

90th Percentile of Response Time per Department = PERCENTILEX.INC('Table', 'Table'[Dept_Leadtime (Hr)], 0.9)
Mean Distinct Count = AVERAGEX('Table',DISTINCTCOUNT('Table'[Request ID]))
Mean Response Time = AVERAGE('Table'[Dept_Leadtime (Hr)])
Mean Response Time at 90th Percentile = AVERAGEX('Table',[90th Percentile of Response Time per Department])
Median Distinct Count = MEDIANX('Table',DISTINCTCOUNT('Table'[Request ID]))
Median Response Time = MEDIAN('Table'[Dept_Leadtime (Hr)])
Median Response Time at 90th Percentile = MEDIANX('Table',[90th Percentile of Response Time per Department])
Sum of Dept_Leadtime per Department = SUM('Table'[Dept_Leadtime (Hr)])

(3) Then the result is as follows.

vtangjiemsft_0-1697683574575.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Robot123 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures. 

90th Percentile of Response Time per Department = PERCENTILEX.INC('Table', 'Table'[Dept_Leadtime (Hr)], 0.9)
Mean Distinct Count = AVERAGEX('Table',DISTINCTCOUNT('Table'[Request ID]))
Mean Response Time = AVERAGE('Table'[Dept_Leadtime (Hr)])
Mean Response Time at 90th Percentile = AVERAGEX('Table',[90th Percentile of Response Time per Department])
Median Distinct Count = MEDIANX('Table',DISTINCTCOUNT('Table'[Request ID]))
Median Response Time = MEDIAN('Table'[Dept_Leadtime (Hr)])
Median Response Time at 90th Percentile = MEDIANX('Table',[90th Percentile of Response Time per Department])
Sum of Dept_Leadtime per Department = SUM('Table'[Dept_Leadtime (Hr)])

(3) Then the result is as follows.

vtangjiemsft_0-1697683574575.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Unknowncharacte
Helper III
Helper III

Try

=CALCULATE(MEDIAN('Table Name'[column name])

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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