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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Calculating Fail Rate

Hi,

I'm trying to do a simple calculations in Power BI with DAX but I can't think of a way to do it for the life of me. I was hoping someone could help.

 

So basically, I have 2 sheets in my Excel file. One of Failed and one is Total.

 

On the Failed sheet, all the failed trades for the month is listed out with broker names next to each trade.

On the Total sheet, all the trades for the month booked is listed out, also with broker names next to each trade.

 

I'm trying to calculcate percentage of failed trades, e.g., if there are 5 trades with broker A in Failed sheet, and 10 trades with broker A in the Total sheet, the Fail rate would be 50%.

 

I tried using Divide and Count in Power BI but it ended up dividing the 5 failed trades by all the trades with all the brokers in the Total sheets, rather than just dividing by the trades specifically with Broker A in the Total Sheet.

 

Thank you in advance!

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

You need to create a common broker table and Date table(need to check data for that)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

 

 

 

 

 

 

 

Failed Tab:

 

Trade ReferenceTrade DateSettlement DateQuantitySecurityBroker
1234522/6/2024/6/20120AB LtdBroker A
6789022/6/2024/6/20130BC LtdBroker A
2345622/6/2024/6/20140De LtdBroker A
3456722/6/2024/6/20150BY LtdBroker B
4567822/6/2024/6/20160VH LtdBroker C
5678922/6/2024/6/20170GO LtdBroker C
1928322/6/2024/6/20180BU LtdBroker C

 

Total Volume tab:

 

Trade ReferenceTrade DateSettlement DateQuantitySecurityBroker
1234522/6/2024/6/20120AB LtdBroker A
6789022/6/2024/6/20130BC LtdBroker A
2345622/6/2024/6/20140De LtdBroker A
3456722/6/2024/6/20150BY LtdBroker B
4567822/6/2024/6/20160VH LtdBroker C
5678922/6/2024/6/20170GO LtdBroker C
1928322/6/2024/6/20180BU LtdBroker C
40120.2857122/6/2024/6/20220DU LTDBroker A
40864.3571422/6/2024/6/20229AM LTDBroker A
41608.4285722/6/2024/6/20228AI LTDBroker A
42352.522/6/2024/6/20227AB LTDBroker B
43096.5714322/6/2024/6/20226BS LTDBroker B
43840.6428622/6/2024/6/20225OQ LTDBroker B
44584.7142922/6/2024/6/20226DH LTDBroker B
45328.7857122/6/2024/6/20227AO LTDBroker B
46072.8571422/6/2024/6/20227AH LTDBroker B
46816.9285722/6/2024/6/20225PS LTDBroker B
4756122/6/2024/6/20224MM LTDBroker B
48305.0714322/6/2024/6/20222AA LTDBroker B

 

 

Thanks!

HI @Anonymous ,

 

 

Create a common Broker Table.

 

Join the relationship with both Failed Table and Volume Table.

 

Create these measures

 

Fail Rates =
VAR a =
    CALCULATE (
        COUNT ( 'Failed Table'[Trade Reference] ),
        FILTER (
            Broker,
            Broker[Broker]
                = MAX ( 'Failed Table'[Broker] )
        )
    )
VAR b =
    CALCULATE (
        COUNT ( 'Volume Table'[Trade Date] ),
        FILTER (
            Broker,
            Broker[Broker]
                = MAX ( 'Volume Table'[Broker] )
        )
    )
RETURN
    DIVIDE (
        a,
        b
    )

 

 

 

Broker TableBroker TableRelationshipRelationshipFinal ValueFinal Value

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.