Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Getting the Average from a Y/N column

Hello Power Bi community   This is a sample of my data table  Site Name Date Status Meets Criteria Nashville 11/10/2020 Verified Y N. Dallas 09/22/2020   N Danville 2/5/2020 ...
  • AllisonKennedy's avatar
    AllisonKennedy
    5 years ago

    Anonymous  OK, so you are looking for percentage by Site Name. Try these measures: 

     

    Total Orders Verified = CALCULATE( COUNT( Table[OrderId]) , Table[Status] = "Verified", Table[ Meets Criteria] = "Y" )

    Total Orders = COUNT( Table[OrderID]) 

     

    Percent Verified = DIVIDE( [Total Orders Verified] , [Total Orders] )

     

    Use a slicer for Site Name or put Percent Verified in a visual with Site Name. If you want this to work when drilling down to order ID level, you'll need to add another filter context shift, for example using: 

     

    Percent Verified This Site = CALCULATE( DIVIDE( [Total Orders Verified] , [Total Orders] ), ALLEXCEPT(Table[Site Name])