You can achieve this in Power BI using DAX to calculate duration percentiles and count records below each threshold for each month, filtered by [Count]=1 and [Service]="No".
Step 1: Filtered Table: Create a calculated table or use DAX filters in your measure to work only with records where [Count]=1 and [Service]="No".
Step 2: Percentile Duration Measures: Create measures for each percentile (e.g., 50%, 90%, 99%):
Duration_50 =
PERCENTILEX.INC(
FILTER('Table', 'Table'[Count]=1 && 'Table'[Service]="No"),
'Table'[Duration],
0.5
)
Duration_90 =
PERCENTILEX.INC(
FILTER('Table', 'Table'[Count]=1 && 'Table'[Service]="No"),
'Table'[Duration],
0.9
)
Duration_99 =
PERCENTILEX.INC(
FILTER('Table', 'Table'[Count]=1 && 'Table'[Service]="No"),
'Table'[Duration],
0.99
)
Step 3: Count Records Below Each Percentile: Create measures to count records with duration less than or equal to each percentile value:
Records_50 =
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[Count]=1 &&
'Table'[Service]="No" &&
'Table'[Duration] <= [Duration_50]
)
)
Records_90 =
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[Count]=1 &&
'Table'[Service]="No" &&
'Table'[Duration] <= [Duration_90]
)
)
Records_99 =
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[Count]=1 &&
'Table'[Service]="No" &&
'Table'[Duration] <= [Duration_99]
)
)