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
Diane_Gribi
Helper I
Helper I

Calculating % Reject from Total Inspections

hi - Looking for some Dax command help.  I am looking to create a graph from data similar to below were for each month I calculate the total number of inspections (which I have managed to do), total number of rejects (which I have gotten), but I am unable to get the %rejects per month (when I try all I am able to get is the %rejection for the total reject (YTD))

 

Can anyone advise what I am doing wrong or suggest a formula that does the above

 

Thanks

 

NumberTypeEvent DateGRI Result  
1Goods Receiving Inspection Report09/01/2023 00:00Reject  
2Goods Receiving Inspection Report10/01/2023 00:00Accept  
3Goods Receiving Inspection Report10/01/2023 00:00Accept  
4Goods Receiving Inspection Report10/01/2023 00:00Reject  
5Goods Receiving Inspection Report10/01/2023 00:00Accept  
6Goods Receiving Inspection Report10/01/2023 00:00Accept  
7Goods Receiving Inspection Report10/01/2023 00:00Accept  
8Goods Receiving Inspection Report06/02/2023 00:00Reject  
9Goods Receiving Inspection Report08/02/2023 00:00Accept  
10Goods Receiving Inspection Report08/02/2023 00:00Accept  
11Goods Receiving Inspection Report08/02/2023 00:00Accept  
12Goods Receiving Inspection Report08/02/2023 00:00Accept  
13Goods Receiving Inspection Report08/02/2023 00:00Accept  
14Goods Receiving Inspection Report08/02/2023 00:00Accept  
15Goods Receiving Inspection Report08/02/2023 00:00Accept  
16Goods Receiving Inspection Report08/02/2023 00:00Accept  
17Goods Receiving Inspection Report08/02/2023 00:00Accept  
18Goods Receiving Inspection Report08/02/2023 00:00Accept  
19Goods Receiving Inspection Report08/02/2023 00:00Accept  
20Goods Receiving Inspection Report08/02/2023 00:00Accept  
21Goods Receiving Inspection Report08/02/2023 00:00Reject  
22Goods Receiving Inspection Report08/02/2023 00:00Accept  
23Goods Receiving Inspection Report08/02/2023 00:00Accept  
24Goods Receiving Inspection Report08/02/2023 00:00Accept  
25Goods Receiving Inspection Report08/02/2023 00:00Accept  
26Goods Receiving Inspection Report01/03/2023 00:00Accept  
27Goods Receiving Inspection Report01/03/2023 00:00Accept  
28Goods Receiving Inspection Report01/03/2023 00:00Accept  
29Goods Receiving Inspection Report01/03/2023 00:00Accept  
30Goods Receiving Inspection Report01/03/2023 00:00Accept  
31Goods Receiving Inspection Report01/03/2023 00:00Accept  
32Goods Receiving Inspection Report01/03/2023 00:00Accept  
33Goods Receiving Inspection Report01/03/2023 00:00Accept  
34Goods Receiving Inspection Report01/03/2023 00:00Reject  
35Goods Receiving Inspection Report01/03/2023 00:00Accept  
36Goods Receiving Inspection Report01/03/2023 00:00Reject  
37Goods Receiving Inspection Report01/03/2023 00:00Accept  
38Goods Receiving Inspection Report01/03/2023 00:00Accept  
39Goods Receiving Inspection Report01/03/2023 00:00Reject  
40Goods Receiving Inspection Report01/03/2023 00:00Accept  
41Goods Receiving Inspection Report01/03/2023 00:00Accept  
42Goods Receiving Inspection Report01/03/2023 00:00Accept  
43Goods Receiving Inspection Report01/03/2023 00:00Accept  
44Goods Receiving Inspection Report01/03/2023 00:00Accept  
45Goods Receiving Inspection Report01/03/2023 00:00Accept  
46Goods Receiving Inspection Report01/03/2023 00:00Accept  
47Goods Receiving Inspection Report01/03/2023 00:00Accept  
48Goods Receiving Inspection Report01/03/2023 00:00Accept  
49Goods Receiving Inspection Report01/03/2023 00:00Accept  
50Goods Receiving Inspection Report01/03/2023 00:00Accept  
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Diane_Gribi Maybe something like this. See PBIX attached below signature.

Measure = 
    VAR __Rejects = COUNTROWS(FILTER('Table', [GRI Result] = "Reject"))
    VAR __Total = COUNTROWS('Table')
    VAR __Result = DIVIDE(__Rejects, __Total)
RETURN
    __Result

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Diane_Gribi Maybe something like this. See PBIX attached below signature.

Measure = 
    VAR __Rejects = COUNTROWS(FILTER('Table', [GRI Result] = "Reject"))
    VAR __Total = COUNTROWS('Table')
    VAR __Result = DIVIDE(__Rejects, __Total)
RETURN
    __Result

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks sorry, meant to reply.  had a little trouble with something else on the file that was showing up strange values, but got it all sorted now.  Thanks

 

Thanks.  I have managed to get my graph, but it is not organising it by month (Jan, Feb, Mar) it looks to have sorted it alphabetically.  Do you know how to reorder it

Measure by Month.PNG

Managed to fix this so no need for a resolution.  Thanks guys

 

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.

Top Solution Authors