Forum Discussion

Lena85's avatar
Lena85
Helper I
4 years ago

incremental row level % with two calculated columns

Hi! 

 

I am looking to divide number of Incorrect checks

( defined as calculated column: 

Incorrect Spotchecks = if('Spotchecks doc customs merged dim parcels'[Price OK]="No" || 'Spotchecks doc customs merged dim parcels'[Quantity OK]="No" || 'Spotchecks doc customs merged dim parcels'[Description OK]="No" || 'Spotchecks doc customs merged dim parcels'[Counterfeit]="Yes" || 'Spotchecks doc customs merged dim parcels'[B2B]="Yes", 1, 0)

 

by  Total checks (defined as calculated column: 

Total Spotchecks = if(NOT(ISBLANK('Spotchecks doc customs merged dim parcels'[Index])),1,0)

 

In such way that not only the Total % value is correct, but such that if I add a date column, the daily % values are also correct, which is not the case currently. 

 

 

Using quick measure Division function creates: 

Count of Incorrect Spotchecks divided by Count of Total Spotchecks = DIVIDE( COUNTA('Spotchecks doc customs merged dim parcels'[Incorrect Spotchecks]), COUNTA('Spotchecks doc customs merged dim parcels'[Total Spotchecks]) )

 

 But that results in each row output of 100% which is incorrect (Incorrect checks =25, total checks =35 so I should get 71% total

 

Is division by calculated columns any different than regular ones? And how can I obtain the division that results in accurate row level % values? Thanks!

3 Replies

  • Count of Incorrect Spotchecks divided by Count of Total Spotchecks =
    DIVIDE(
        COUNTA('Spotchecks doc customs merged dim parcels'[Incorrect Spotchecks]),
        COUNTA('Spotchecks doc customs merged dim parcels'[Total Spotchecks])
    )
     
    The last column should have given a result of diving the incorrect spotchecks by the total spotchecks on each row, so 1/4 for first date, 2/4 for the next one, etc. BIBen is there anything else you need?