Forum Discussion

StuartSmith's avatar
StuartSmith
Power Participant
5 years ago
Solved

Incorrect Percentage Value

I have a table containing 67 row...

Count_Total_Row_Measure = COUNTROWS(Services)

 
That contains a column called "VoWiFi" that contains 22 "Yes" values...
Count_Rows_Where_No_Measure = CALCULATE(COUNTROWS(Services),SEARCH("Yes", Services[VoWIFI],,0))
 
I then want to get the percentage of rows containing "Yes" values from the number of rows.
VoWiFi % YESS = DIVIDE(CALCULATE(COUNTROWS(Services),SEARCH("Yes", Services[VoWIFI],,0)), CALCULATE ( COUNT ( 'Services'[VoWIFI] ), ALLSELECTED ( 'Services'[VoWIFI])))
 
But instead of giving "32.83%", the output is "0.79".  What am i doing wrong
  • amitchandak's avatar
    amitchandak
    5 years ago

    StuartSmith , I created

    Measure = DIVIDE([Count_Rows_Where_No_Measure],[Count_Total_Row_Measure])

     

    Marked it as % type and seems to to give the number you want

3 Replies

  • StuartSmith , first one done not have all selected

     

    then you should try

    VoWiFi % YESS = DIVIDE(CALCULATE(COUNTROWS(Services),SEARCH("Yes", Services[VoWIFI],,0)>0), CALCULATE ( COUNT ( 'Services'[VoWIFI] )))

     

    or

     

    VoWiFi % YESS = DIVIDE(CALCULATE(COUNTROWS(Services),SEARCH("Yes", Services[VoWIFI],,0)>0), CALCULATE ( COUNT ( 'Services'[VoWIFI] ), ALL( 'Services'[VoWIFI])))

     

    VoWiFi % YESS = DIVIDE(CALCULATE(COUNTROWS(Services),SEARCH("Yes", Services[VoWIFI],,0)>0), CALCULATE ( COUNT ( 'Services'[VoWIFI] ), ALLSELECTED ( 'Services'[VoWIFI])))

     

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