Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
ephramz
Helper II
Helper II

Help needed to calculate median based on a measure

 

I'm encountering this problem whereby I have a measure that calculates the Actual Time, based on equipment number and operation number in the matrix table visual ontop.

 

I created another table visualization at the bottom and I wish to have a measure that calculates the median of these 'Actual Time Values' without counting/ignoring cells that contains the value 0

 

Currently my dax function for this median measure is as follows:

Median = MEDIANX(SUMMARIZE('ENGG VW_TRM','ENGG VW_TRM'[Op. No.],'ENGG VW_TRM'[Equipment]),[Actual Time])

However, this measure includes all the cells that contains the value 0 

 

How can I work around this.

Help is really appreciated. Thanks all 

 

ephramz_0-1631090444257.png

 

Regards,

Ephram

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ephramz , Try like

 


if [Actual Time] is a column

Median = MEDIANX(SUMMARIZE(filter('ENGG VW_TRM',[Actual Time] <>0 ),'ENGG VW_TRM'[Op. No.],'ENGG VW_TRM'[Equipment], "_1", sum([Actual Time]) ),[_1])

 

 

if [Actual Time] is a measure

Median = MEDIANX(filter(SUMMARIZE('ENGG VW_TRM','ENGG VW_TRM'[Op. No.],'ENGG VW_TRM'[Equipment],"_1",[Actual Time]), [_1]<>0),[_1])

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ephramz , Try like

 


if [Actual Time] is a column

Median = MEDIANX(SUMMARIZE(filter('ENGG VW_TRM',[Actual Time] <>0 ),'ENGG VW_TRM'[Op. No.],'ENGG VW_TRM'[Equipment], "_1", sum([Actual Time]) ),[_1])

 

 

if [Actual Time] is a measure

Median = MEDIANX(filter(SUMMARIZE('ENGG VW_TRM','ENGG VW_TRM'[Op. No.],'ENGG VW_TRM'[Equipment],"_1",[Actual Time]), [_1]<>0),[_1])

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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