Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I have a calculation for median that is built from this formula.
Median Latency Test =
VAR NumValuesHalved = COUNT ( Query2[Latency] ) / 2
RETURN
MINX (
FILTER (
VALUES ( Query2[Latency]),
CALCULATE (
COUNT ( Query2[Latency]),
Query2[Latency] <= EARLIER ( Query2[Latency] )
)
< NumValuesHalved
),
Query2[Latency]
)
I am wondering how to alter this formula to filter out 0/negative/null values so that they are not utilized in the calculation of Median Latency. Can anyone help with this?
Solved! Go to Solution.
Hi @Artemis1254
Give this a try
Median Latency Test =
VAR NumValuesHalved =
COUNT ( Query2[Latency] ) / 2
RETURN
MINX (
FILTER (
VALUES ( Query2[Latency] ),
Query2[Latency] > 0
&& CALCULATE (
COUNT ( Query2[Latency] ),
Query2[Latency] <= EARLIER ( Query2[Latency] )
)
< NumValuesHalved
),
Query2[Latency]
)
Hi @Artemis1254
Give this a try
Median Latency Test =
VAR NumValuesHalved =
COUNT ( Query2[Latency] ) / 2
RETURN
MINX (
FILTER (
VALUES ( Query2[Latency] ),
Query2[Latency] > 0
&& CALCULATE (
COUNT ( Query2[Latency] ),
Query2[Latency] <= EARLIER ( Query2[Latency] )
)
< NumValuesHalved
),
Query2[Latency]
)
Thank you so much. This works!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!