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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sindhusabbineni
Regular Visitor

How to calculate the percentage of values group by date in power bi

I have a sample data as below. 

TestDateStatus
1/8/2019PASS
1/8/2019PASS
1/8/2019FAIL
2/8/2019PASS
2/8/2019FAIL

 

I want to calculate the percentage of PASS percentage(Total Number of Pass cases/Total Number of Cases) and FAIL percentage (Total Number of Fail Cases/Total Number of Cases) status for each day. I tried as below but it's not giving me the expected results.

 

Blocked by date = Calculate (
                     countrows (TableName),
                    (TableName[TestDate].[Date],[Total BLOCKED])
)

Here Total BLOCKED is the measure I created to filter the status.

Where am I going wrong here? How should I calculate the percentage of PASS and FAIL status for each day?

1 REPLY 1
AlB
Super User
Super User

Hi @sindhusabbineni 

I'm not sure I understand what you need but try this:

1. Place Table1[TestDate] in the rows of a matrix visual and Table1[Status] in the columns

2. Create this measure (format as %) and place it in the visual 

PercPASS =
DIVIDE (
    COUNT ( Table1[Status] ),
    CALCULATE ( COUNT ( Table1[Status] ), ALL ( TAble1[Status] ) )
)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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