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 am calculating the average of the sum of the percentiles of the max values. So I have a table with testresults (values) from a certain category. What I did is, I calculated the MAX of each variable, then got the percentile of each value in the category, then summed them to get the average, but my method is not really scalable when I have to average more than 3 values.
Is there a better way?
The trick is to work with tables rather than individual variables.
I can't promise this will work perfectly but it should help point you in the right direction:
Average Percentile =
VAR Categories =
TREATAS ( { "Bench Score", "SDS Score", "Watt Bike" }, Testing[Kenmerk] )
VAR MaxScores =
ADDCOLUMNS ( Categories, "@Max", CALCULATE ( MAX ( Testing[Waarde] ) ) )
VAR Percentiles =
ADDCOLUMNS (
MaxScores,
"@Perc",
VAR MaxScore = [@Max]
RETURN
DIVIDE (
CALCULATE ( COUNTROWS ( Testing ), Testing[Waarde] < MaxScore ),
CALCULATE ( COUNTROWS ( Testing ) ),
0
)
)
RETURN
AVERAGEX ( Percentiles, [@Perc] )
Hi Alexis,
Thanks for the reply. Doesn't seem to work.. Probably because I work in two different tables to filter afterwards using the Testing 2 for benchmark purposes.
Not surprising. You'll need to adjust it for your exact situation. I intended it more as a suggested pattern than a final solution since I have nothing to test against.
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 |
---|---|
44 | |
21 | |
20 | |
15 | |
13 |
User | Count |
---|---|
45 | |
41 | |
39 | |
19 | |
19 |