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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mohittimpus
Helper V
Helper V

Not getting correct value of median

I have 2 Tables:

1) Date

2) Employee_Info


'Date' master table is connected with Employee_Info.


I have created one table visualization inside Employe_Info.pbix file. Table is filter with Year.


1) Inside Employee_Info.pbix "Fiscal Month" is taking from Date table, after that I created one Measure with name "#Count Employee" which calculate total 'Count of Employee' column.

 

#Count Employee = CALCULATE(SUM(Employee_Info[Count of Employee]))

 

2) After that I created  Measure with name "Rank of Employee" Which is getting rank of Employee based on fiscal Month.

 

Rank of Employee = if([#Count Employee]>0 || [#Count Employee]<>BLANK(),RANKX (FILTER(ALLSELECTED('Date'[Fiscal Month]),[#Count Employee]<>0 || [#Count Employee]<>BLANK()), [#Count Employee],,ASC,Dense))

 

 

3) Finally I am calculating 'Median' of "#Count Employee" for that I have created Measure with name "Median_of_Emp" with couple of steps followed inside "Median_of_Emp" Measure. 


Median_of_Employee =

VAR _tbl =
SUMMARIZE(
CALCULATETABLE(
'Date',
ALLSELECTED( 'Date'[Fiscal Month] )
),
'Date'[Fiscal Month]
)
RETURN
IF([#Count Employee]>0,
INT(MEDIANX( _tbl, [#Count Employee]))
)



******Now I am not getting correct value 63.64 or Roundup 64 for  "Median_of_Employee" Measure. How to get correct value in Median_of_Employee Measure.

Below I am showing image:

 

Screenshot_2.png

@Mariusz  any Idea about it.

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @mohittimpus 

 

Please see the below calculation result of a Median function in Excel based on this sample.

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

View solution in original post

1 REPLY 1
Mariusz
Community Champion
Community Champion

Hi @mohittimpus 

 

Please see the below calculation result of a Median function in Excel based on this sample.

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors