Dev.to Security 🔐 Cybersecurity 👁 0 📖 8 min read

8 Security KPIs and the DAX to Compute Them

Security dashboards go wrong in predictable ways. A vulnerability "MTTR" that follows the discovery date instead of the fix date. An "open backlog" that disappears when you slice to last month. An EDR coverage percentage

Security dashboards go wrong in predictable ways. A vulnerability "MTTR" that follows the discovery date instead of the fix date. An "open backlog" that disappears when you slice to last month. An EDR coverage percentage that quietly includes printers and other N/A assets in the denominator. A phishing click rate with no defined delivered volume.

The eight measures below are the ones I use for a monthly IT and security KPI report in Power BI. They are written as DAX you can paste. I also publish a build kit that includes these measures, 12 months of fictional sample data, and a table of expected values — I disclose that at the end — but you can use the DAX on your own model if your column names match.

Two limits, up front. The measures were logic-checked by recomputing every result from the sample data in Python and SQL; they were not executed in Power BI Desktop for the published v0.1 kit. The expected values in this article are that independent recomputation, rounded the way the build guide shows them. And the sample numbers are fictional. They are a way to confirm a build, not a benchmark for your organization.

This is reporting, not a certification path. Nothing here makes an environment "compliant."

Two helper measures you need first

Point-in-time numbers (open findings, coverage snapshots) and period numbers (findings discovered this month, incidents detected this month) have to agree on what "the end of the period" means. I keep a reporting cut-off on a one-row Settings table, and I cap the selected dates at that cut-off so a future date on the axis cannot invent a backlog.

As Of Date =
MAX ( Settings[AsOfDate] )
Period End =
VAR _lastSelected = MAX ( DimDate[Date] )
RETURN
    MIN ( _lastSelected, [As Of Date] )

DimDate must be marked as a date table on DimDate[Date]. In the sample model the as-of date is 2026-10-31. With no slicers, Period End is also 2026-10-31. With Quarter = 2026-Q3 selected, Period End becomes 2026-09-30, and the open-backlog and coverage measures move to that month-end.

1. Vulnerability SLA compliance

Definition: of the findings fixed in the selected period, the share that were fixed on or before their due date (discovery date plus the severity's SLA days). Accepted risk and false positives are closures, not fixes, so they are excluded.

This needs an inactive relationship from FactVulnerability[DateRemediated] to DimDate[Date]. The active relationship stays on DateDiscovered, so "Vulns Discovered" and "Vulns Remediated" can cover the same month without fighting each other. USERELATIONSHIP turns the remediation relationship on for this measure.

Vuln SLA Compliance % =
VAR _fixedWithinSla =
    CALCULATE (
        SUMX (
            FactVulnerability,
            IF ( FactVulnerability[DateRemediated] <= FactVulnerability[DueDate], 1, 0 )
        ),
        USERELATIONSHIP ( FactVulnerability[DateRemediated], DimDate[Date] ),
        FactVulnerability[Status] IN { "Patched", "Mitigated" }
    )
RETURN
    DIVIDE ( _fixedWithinSla, [Vulns Remediated] )

With the sample data and no slicers, this is 85.0% (807 remediations). For October 2026 it is 86.6% (67 remediations). For Critical findings only, it drops to 81.0%. DIVIDE returns blank if nothing was remediated in the period, which is better than a full-year 100% hiding a month with no fixes.

The SLA days themselves (7 / 14 / 30 / 90 in the sample) are editable defaults on DimSeverity, not a recommendation for your organization.

2. Vulnerability MTTR, in calendar days

Definition: average calendar days from discovery to remediation, for findings fixed in the selected period, again dated by DateRemediated.

Vuln MTTR (days) =
CALCULATE (
    AVERAGEX (
        FactVulnerability,
        DATEDIFF ( FactVulnerability[DateDiscovered], FactVulnerability[DateRemediated], DAY )
    ),
    USERELATIONSHIP ( FactVulnerability[DateRemediated], DimDate[Date] ),
    FactVulnerability[Status] IN { "Patched", "Mitigated" }
)

Sample, no slicers: 22.2 days. October 2026: 23.0 days. Critical only: 4.8 days — faster, as you would hope, and a useful check that the severity slice is actually reaching the measure. These are calendar days, not business days.

3. Open overdue vulnerabilities

Definition: of the findings that were still open at Period End, the share whose due date is already before that date.

"Open" is the part people usually get wrong. If you write COUNTROWS(FactVulnerability) and rely on the date slicer, last month's slice will hide older open items. The measure has to clear the period filter, then keep rows discovered on or before period end that were not yet closed at that date:

Open Vulns =
VAR _end = [Period End]
RETURN
    CALCULATE (
        COUNTROWS ( FactVulnerability ),
        REMOVEFILTERS ( DimDate ),
        FILTER (
            ALL (
                FactVulnerability[DateDiscovered],
                FactVulnerability[DateRemediated],
                FactVulnerability[Status]
            ),
            FactVulnerability[DateDiscovered] <= _end
                && (
                    FactVulnerability[DateRemediated] > _end
                        || (
                            ISBLANK ( FactVulnerability[DateRemediated] )
                                && FactVulnerability[Status] IN { "New", "Triaged", "Remediation In Progress" }
                        )
                )
        )
    )

A closed row with no DateRemediated (for example Accepted Risk with no decision date) is treated as closed, not as eternal backlog. Severity, asset, and department filters are left in place, so the overdue measure can add a due-date filter on top:

Open Overdue Vulns =
VAR _end = [Period End]
RETURN
    CALCULATE (
        [Open Vulns],
        FactVulnerability[DueDate] < _end
    )
Open Overdue Vulns % =
DIVIDE ( [Open Overdue Vulns], [Open Vulns] )

Sample, no slicers (period end 2026-10-31): 79 open, 25 overdue, 31.6%. Slice to October 2026 and you get the same three numbers, because the period end is still 31 October. Slice to 2026-Q3 and they move to the 30 September position: 87 open, 20 overdue, 23.0%. That is the point of Period End.

4. Incidents contained within target

Definition: of incidents that have a containment timestamp, the share whose detection-to-containment hours were within the severity's target on DimSeverity[IncidentContainTargetHours].

Incidents Contained Within Target % =
VAR _contained =
    COUNTROWS ( FILTER ( FactIncident, NOT ISBLANK ( FactIncident[ContainedAt] ) ) )
VAR _withinTarget =
    COUNTROWS (
        FILTER (
            FactIncident,
            NOT ISBLANK ( FactIncident[ContainedAt] )
                && DATEDIFF ( FactIncident[DetectedAt], FactIncident[ContainedAt], MINUTE ) / 60
                    <= RELATED ( DimSeverity[IncidentContainTargetHours] )
        )
    )
RETURN
    DIVIDE ( _withinTarget, _contained )

DATEDIFF in minutes, divided by 60, keeps fractions of an hour. The sample targets (4 / 24 / 72 / 168 hours) are placeholders; set your own. Sample, no slicers: 86.8%. October 2026: 87.5%. Critical only: 80.0%. The percentage is of incidents that have a ContainedAt value, not of every incident in the period (the sample has 122, 9, and 5 incidents in those three views).

I also track mean time to contain and mean time to resolve with the same DATEDIFF pattern — DetectedAt to ContainedAt, and DetectedAt to ResolvedAt — but the percentage against a target is the number I would put on an overview card. An average can look healthy while the misses cluster in one severity.

5. Access review completion

Definition: review lines whose campaign is due in the selected period, with CompletionStatus of Complete or Exception, divided by all such lines. A documented exception counts as reviewed. An exception that never expires is a different problem, and this measure will not catch it.

Access Review Completion % =
DIVIDE (
    CALCULATE ( [Access Review Items], FactAccessReview[CompletionStatus] IN { "Complete", "Exception" } ),
    [Access Review Items]
)

Access Review Items is a COUNTROWS of FactAccessReview, filtered by the active relationship on CampaignDueDate. Sample, no slicers: 88.7% of 1,013 lines. For 2026-Q3: 99.5% of 200 lines. For October 2026 the cards are blank, not zero: no campaign is due in that month, and DIVIDE has nothing to divide. If you see 0% in a month with no campaign, the measure is counting the wrong thing.

6. Terminated people whose access was not revoked

Definition: access-review lines for terminated people whose review decision is not Revoke. The target is 0.

Terminated Still Active =
CALCULATE (
    [Access Review Items],
    FactAccessReview[EmploymentStatus] = "Terminated",
    FactAccessReview[ReviewDecision] <> "Revoke"
)

Sample, no slicers: 5. For Finance only: 2. For October 2026: blank, for the same reason as the completion rate — there are no campaign-due rows in that month, so this is not a substitute for a live offboarding log. Use it next to the campaign that actually reviewed those accounts. Any non-zero value is unfinished work, even if completion % looks high.

7. EDR coverage, from a month-end snapshot

Definition: in the latest coverage snapshot on or before Period End, assets with EDRInstalled = Yes, divided by assets where EDR applies (Yes or No). N/A is excluded from the denominator so a printer or a network switch does not inflate the percentage.

Coverage must not be summed across months. I resolve one snapshot date first, with REMOVEFILTERS on the fact so a department slice that is missing from the latest snapshot shows blank instead of silently falling back to an older month. The coverage measure then reads only that date:

EDR Coverage % =
VAR _snap = [Coverage Snapshot Date]
VAR _covered =
    CALCULATE (
        COUNTROWS ( FactAssetCoverage ),
        REMOVEFILTERS ( DimDate ),
        FactAssetCoverage[SnapshotDate] = _snap,
        FactAssetCoverage[EDRInstalled] = "Yes"
    )
VAR _applicable =
    CALCULATE (
        COUNTROWS ( FactAssetCoverage ),
        REMOVEFILTERS ( DimDate ),
        FactAssetCoverage[SnapshotDate] = _snap,
        FactAssetCoverage[EDRInstalled] IN { "Yes", "No" }
    )
RETURN
    DIVIDE ( _covered, _applicable )

Coverage Snapshot Date is MAX(FactAssetCoverage[SnapshotDate]) on or before Period End. Sample, no slicers: 95.9%, with 9 assets missing EDR, from 252 in-service assets on 2026-10-31. At 30 September: 95.0%, 11 missing. At 31 December 2025: 87.2%, 28 missing. October 2026 matches the all-dates figure, again because the snapshot date is the same. Pair the percentage with the missing-asset count, or the card will look fine while nine endpoints stay unprotected.

Patch compliance uses the same snapshot pattern, with PatchStatus = "Current" over everything except Not Applicable. In the sample, that is 90.2% on 2026-10-31.

8. Phishing simulation click rate

Definition: simulated phishing emails clicked, divided by emails delivered in the selected period.

Phishing Click Rate % =
DIVIDE ( SUM ( FactPhishing[Clicked] ), [Phishing Emails Delivered] )

Sample, no slicers: 10.7% of 3,614 emails delivered. October 2026: 6.2% of 306. Finance: 12.5% of 327. I would not report the click rate without the delivered volume next to it, and I would put the report rate and the credential-submission rate on the same page. In the sample, the all-dates report rate is 31.4% and the credential-submission rate is 3.3%.

A compact check table

These are the guide values for the eight measures (plus the two helpers), from the fictional sample, rounded as displayed. A is no slicers. B is Month = 2026-10. "(Blank)" means there are no rows, not a zero.

Measure A (all dates) B (October 2026)
As Of Date 2026-10-31 2026-10-31
Period End 2026-10-31 2026-10-31
Vuln SLA Compliance % 85.0% 86.6%
Vuln MTTR (days) 22.2 23.0
Open Overdue Vulns % 31.6% (25 of 79) 31.6% (25 of 79)
Incidents Contained Within Target % 86.8% 87.5%
Access Review Completion % 88.7% (Blank)
Terminated Still Active 5 (Blank)
EDR Coverage % 95.9% 95.9%
Phishing Click Rate % 10.7% 6.2%

If you build this model and a card disagrees, check the inactive remediation relationship, that DimDate is marked as a date table, and that coverage is not being summed across snapshots.

A kit, not a finished file

I publish these measures, the sample model, Power Query scripts, and the full expected-value table (six filter scenarios, 41 measures) as the IT & Security KPI Dashboard Template for Power BI, a $29 build kit: https://payhip.com/b/BRMqe. Version 0.1 does not include a .pbix or .pbit file; you build the report in Power BI Desktop for Windows by following the guide, then save your own template. The page images on the product listing are illustrative mockups rendered from the sample data, not Power BI screenshots. I am the author, so treat that as a first-party link, not an independent review. You do not need the kit to use the DAX above.

Disclosure

I sell the Power BI build kit linked above. This article was drafted with AI assistance and reviewed by me. I stand by the measure definitions, the DAX, and the sample expected values; any remaining mistakes are mine. Not affiliated with or endorsed by Microsoft. Power BI is a trademark of Microsoft Corporation.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.