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.
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
101 | |
78 | |
75 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |