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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to calculate Percentage for Successful Status for Different Categories?

I have following data: 

JobNameStatus
ASuccess
AFailure
AInternal Error
BSuccess
BSuccess
ASuccess
ASuccess
CFailure
AFailure
CSuccess
CInternal Error
CInternal Error
BSuccess
BFailure
VSuccess
AInternal Error
CInternal Error
SSuccess
SInternal Error



I want to have Count of Records with Status 'Success' for every JobName.
I do not want to calculate a separate table as it doesn't interact with the timeline slicer, rather a column.

SuccessCount =
var Job = [JobName]
var Total = CALCULATE(COUNT(combined_csv[JobName]);combined_csv[JobName] = Job)
var Success = CALCULATE(COUNT(combined_csv[JobName]);combined_csv[JobName] = Job; combined_csv[Status]="Success")
return DIVIDE(CALCULATE(COUNT(combined_csv[JobName]); combined_csv[Status]="Success");CALCULATE(COUNT(combined_csv[JobName])))

But it's giving me wrong result.
Can anybody help in this!

 

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create measure like DAX below.

 

SuccessCount =
DIVIDE (
    CALCULATE (
        COUNT ( 'combined_csv'[JobName] ),
        FILTER (
            ALLSELECTED ( 'combined_csv' ),
            'combined_csv'[JobName] = MAX ( 'combined_csv'[JobName] )
                && 'combined_csv'[Status] = "Success"
        )
    ),
    CALCULATE (
        COUNT ( 'combined_csv'[JobName] ),
        FILTER (
            'combined_csv',
            'combined_csv'[JobName] = MAX ( 'combined_csv'[JobName] )
        )
    )
)

 

Best Regards,

 

Amy

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create measure like DAX below.

 

SuccessCount =
DIVIDE (
    CALCULATE (
        COUNT ( 'combined_csv'[JobName] ),
        FILTER (
            ALLSELECTED ( 'combined_csv' ),
            'combined_csv'[JobName] = MAX ( 'combined_csv'[JobName] )
                && 'combined_csv'[Status] = "Success"
        )
    ),
    CALCULATE (
        COUNT ( 'combined_csv'[JobName] ),
        FILTER (
            'combined_csv',
            'combined_csv'[JobName] = MAX ( 'combined_csv'[JobName] )
        )
    )
)

 

Best Regards,

 

Amy

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.