How to Count Tickets and Calculate SLA Percentages in Power BI
Question details
The user wants to group support tickets by Priority, count the total number of tickets, and calculate the percentage of tickets that met the SLA (marked as 'No' under SLA Breached) in a Power BI table visual.

- Product
- Microsoft Power BI
- Device & OS
- not provided
- Scenario
- Creating helpdesk or IT service management reports to analyze SLA compliance rates.
- Observed behavior
- Calculating the total rows and conditional percentage using DAX and displaying the aggregated metrics in a table visualization.
Ensure your Power BI data model includes a table with distinct 'Priority' and 'SLA Breached' columns, and verify that the 'SLA Breached' values are consistently formatted (e.g., exactly 'Yes' and 'No').
Use DAX Measures to Count Tickets and Determine SLA Compliance
Creating custom DAX measures is the most dynamic way to calculate ticket totals and conditional percentages for your Power BI visuals.
By using the COUNTROWS and DIVIDE functions combined with CALCULATE, you can dynamically filter data to find the exact percentage of tickets that did not breach the SLA. This allows the metrics to recalculate automatically if you add date or department slicers.
Navigate to the Data pane, right-click your 'Tickets' table, and select 'New measure'. Enter the formula: Tickets = COUNTROWS('Tickets') to count the total volume of tickets.
Create another new measure for the percentage. Enter the formula: SLA Compliance % = DIVIDE(CALCULATE(COUNTROWS('Tickets'), 'Tickets'[SLA Breached] = "No"), COUNTROWS('Tickets')).
Select your new 'SLA Compliance %' measure in the Data pane. Open the 'Measure tools' tab on the top ribbon and click the '%' icon to format the decimal value as a percentage.
Drag a 'Table' or 'Matrix' visual onto your report canvas. Add your 'Priority' column, followed by the 'Tickets' measure and the 'SLA Compliance %' measure to the Columns well to complete the grouping.

Analyze Support Data with WPS Office
While Power BI is excellent for complex enterprise dashboards, many ticket analysis and SLA calculation tasks can be done quickly and easily using spreadsheets. WPS Office offers a lightweight, highly compatible alternative to Microsoft Office for all your data reporting needs, allowing you to build pivot tables and charts without writing DAX code.

Frequently Asked Questions
What is the best DAX function to count rows in a Power BI table?
The COUNTROWS function is highly recommended over COUNT because it counts every row in the specified table, even if some columns contain blank values. This ensures an accurate total ticket count regardless of missing data.
Why is my SLA Compliance percentage showing as a blank or returning an error?
This usually happens if the denominator in your calculation is zero or if there are spelling mismatches (e.g., your data contains 'False' instead of 'No' for SLA Breached). Using the DIVIDE function safely handles divide-by-zero errors by returning a blank rather than breaking your visual.
Can I filter the SLA compliance metric by date range?
Yes. Because you built the SLA calculation using DAX measures, you can safely add a Date slicer to your Power BI report canvas. The CALCULATE and COUNTROWS functions will automatically adapt and recalculate based on the filtered date range.




