Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
JohnFabric
Helper I
Helper I

Question on measures and calculations in regards to change failure rate

Hello, I have a PowerBI report that lists our IT changes, and if they were successful or not over the past twelve months

 

JohnFabric_1-1724891242610.png

 

 

This is great and works well, but I also want to calculate the change failure rate on a month to month basis. That calculcation is

 

Change Failure for a month = SUM(Closed - Backout for a month, Closed - Issues for a month)/Total(all items)

 

 

 

so for August 2023 above it would be 

 

(2+11)/(2+11+324) = 3.8%

 

But I cannot figure out how to do that in PowerBI. The API that gives me this information returns items on a per change basis:

JohnFabric_2-1724891287708.png

So when I go to add a measure to calculate this it doesn't offer me an option that would allow me to calculate it per month

 

JohnFabric_3-1724891376952.png

 

How can I calculate the per month failure rate?

 

Thank you!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JohnFabric ,

 

Based on your description, would you like to calculate the rate of Backout and Issues in a month relative to all status in the month? If yes, you can refer to my test below.

 

Create a measure.

 

Rate = COUNTROWS( FILTER( ALL( 'Table'),(Table[Status]="Backout"||[Status]="Issues")&&MONTH([Date])=MONTH( MAX('Table'[Date])) ))/COUNTROWS( FILTER(ALL( 'Table'),MONTH([Date])=MONTH( MAX('Table'[Date]))))

 

My table.

vmengmlimsft_0-1724995642578.png

The result of my test.

vmengmlimsft_2-1724995719312.png

 

You can hide other two “Rate” columns.

vmengmlimsft_3-1724995743944.png

 

 

 

Best regards,

Mengmeng Li

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @JohnFabric ,

 

Based on your description, would you like to calculate the rate of Backout and Issues in a month relative to all status in the month? If yes, you can refer to my test below.

 

Create a measure.

 

Rate = COUNTROWS( FILTER( ALL( 'Table'),(Table[Status]="Backout"||[Status]="Issues")&&MONTH([Date])=MONTH( MAX('Table'[Date])) ))/COUNTROWS( FILTER(ALL( 'Table'),MONTH([Date])=MONTH( MAX('Table'[Date]))))

 

My table.

vmengmlimsft_0-1724995642578.png

The result of my test.

vmengmlimsft_2-1724995719312.png

 

You can hide other two “Rate” columns.

vmengmlimsft_3-1724995743944.png

 

 

 

Best regards,

Mengmeng Li

Thank you! That is what I am looking for and it gets me close with my data.

 

Here is what my table is (I've been tranforming some of the data)

 

JohnFabric_0-1725400296566.png

 

And here is my measure

 

Rate = COUNTROWS( FILTER( ALL( 'Change Failure Rate'),('Change Failure Rate'[result.state]="Change Failure Rate")&&MONTH([result.closed_at].[MonthNo])=MONTH( MAX('Change Failure Rate'[result.closed_at].[MonthNo])) ))/COUNTROWS( FILTER(ALL( 'Change Failure Rate'),MONTH([result.closed_at].[MonthNo])=MONTH( MAX('Change Failure Rate'[result.closed_at].[MonthNo]))))
 
And now my graph looks like this
 
JohnFabric_1-1725400400861.png

It seems to be some issue with the years, because I only have data going back 12 calendar months, so there is no data for pre-August 2023. Additionally, the data is being calculated out to exactly the same rate for all months, even though the rate varies month to month. Any idea on how I could fix this?

 

Okay! I got this working, my issue was the months were being double counted because I was attemping to turn a MonthNo into a Month, rather then comparing the values directly via datetime (which the data is in)

 

So my new measure is

 

Rate = COUNTROWS( FILTER( ALL( 'Change Failure Rate'),('Change Failure Rate'[result.state]="Change Failure Rate")&&[result.closed_at].[MonthNo]=(MAX('Change Failure Rate'[result.closed_at].[MonthNo]))&&[result.closed_at].[Year]=(MAX('Change Failure Rate'[result.closed_at].[Year] ))))/COUNTROWS( FILTER(ALL( 'Change Failure Rate'),[result.closed_at].[MonthNo]=MAX('Change Failure Rate'[result.closed_at].[MonthNo])&&[result.closed_at].[Year]=(MAX('Change Failure Rate'[result.closed_at].[Year]))))
 
And that gives me the correct data back
 
JohnFabric_0-1725401349445.png

Thank you for your help!

Hello @Anonymous , I am trying to enhance this measure now and am not sure how to. I have modified my original query to include the area the change was introduced in

 

JohnFabric_0-1725651123038.png

Values are redacted for privacy, but its stuff like "Azure server upgrade" and "Firewall change".  I then want to filter on my graph by this value

 

JohnFabric_1-1725651228315.png

So I can basically say "what was the change failure rate for all firewall changes" instead of all changes. However since my graph is based on a measurement, the measurement doesnt change when I filter on 'CMDB name'. Do you know how I could get it to display the Change Failure Rate of different CMDB names?

ryan_mayu
Super User
Super User

could you pls provide some sample data and the expected output based on that?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




The data comes back from the API like this

JohnFabric_0-1724954242568.png

 

I can then summerize this data with a graph like this:

JohnFabric_1-1724954282570.png

 

Which gives me the below information. The expected output I want to generate is the new column at the end, Change failure rate for that month

 

MonthClosed - BackoutClosed - IssuesClosed - SuccessfulChange Failure Rate for the month (This is what I'm trying to calculate)
August2113243.8%
Steptember4143055.5%

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.