I have a table in Power BI with 3 columns:
| Company Code | HOLDER ID | UNPRESENTED SUM
There are multiple holder IDs per company code. I want to calculate the number of holder IDs whose payment value is below the 90th Percentile. I have successfully calculated the 90th Percentile using the below:
PERCENTILE90 =
PERCENTILE.INC(
UNPRESENTED[UNPRESENTED SUM],0.90
)
However, when I try to calculate the number of holders whose values are below the 90th percentile, the measure I get is blank.
I have tried two different ways:
1. METHOD 1
First, a measure to determine if below 90th Percentile:
Is Below 90th Percentile =
VAR Percentile90 = [PERCENTILE90]
RETURN
IF(
MAX('UNPRESENTED'[UNPRESENTED SUM]) < Percentile90,
1,
0
)
Then, a measure to count the holders:
HOLDERS < 90 =
CALCULATE(
DISTINCTCOUNT(UNPRESENTED[HOLDER ID]),
FILTER(
UNPRESENTED,
[Is Below 90th Percentile] = 1
)
)
This failed.
2. METHOD 2
A calculated column to return 1 or 0 if value is below 90th percentile:
Below 90th? =
VAR Percentile90 =
CALCULATE(
PERCENTILE.INC(
UNPRESENTED[UNPRESENTED SUM], 0.9
)
)
RETURN
IF(
UNPRESENTED[UNPRESENTED SUM] < Percentile90, 1, 0
)
and this returned all 0s, which is obviously wrong, as most values should be below the value of 90th percentile.
Any ideas what I am missing?
Hild333_TML is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.