Forum Discussion

nanchil's avatar
nanchil
New Member
6 years ago
Solved

Help with summing alternative columns

Hello everyone,

 

Thanks in advance for your help.  The last row is the formula that needed to be calculated.  Any help is apprecaited.

 

 NegNeg Percent Of Total TestedPendingPending Percent Of Total TestedPosPos Percent of Total TestedPos Percent Of Known ResultsTotal tested
Test 1233449.021653.47226247.5149.224761
Test 222847.01163.324149.6951.39485
Total2562 (B7)
48.84181 (D7)
3.452503 (F7)
47.7149.425246 (I7)
 SUMCell B7/I7 (2562/5246)SUMCell D7/I7 (181/5246)SUMCell F7/I7   (2503/5246)Cell F7/(F7+B7)   (2503/2503+2562)SUM
  • hi  nanchil 

    For SUM calculation, you could just drag the field into visual directly,

    for Percent measure, you could create this measure as below:

    Measure Neg Percent Of Total Tested = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Neg] ) ),
        CALCULATE ( SUM ( 'Table'[Total tested] ) )
    )
    Measure Pending Percent Of Total Tested = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Pending] ) ),
        CALCULATE ( SUM ( 'Table'[Total tested] ) )
    )
    Measure Pos Percent Of Known Results = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Pos] ) ),
        CALCULATE ( SUM ( 'Table'[Pos] ) )+CALCULATE(SUM('Table'[Neg]))
    )
    Measure Pos Percent of Total Tested = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Pos] ) ),
        CALCULATE ( SUM ( 'Table'[Total tested] ) )
    )

     

    Result:

     

    and here is sample pbix file, please try it.

     

    Regards,

    Lin

4 Replies

  • nanchil , we are not seeing excel cells here, so not very clear.

    Can you share sample data and sample output.

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi  nanchil 

    For SUM calculation, you could just drag the field into visual directly,

    for Percent measure, you could create this measure as below:

    Measure Neg Percent Of Total Tested = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Neg] ) ),
        CALCULATE ( SUM ( 'Table'[Total tested] ) )
    )
    Measure Pending Percent Of Total Tested = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Pending] ) ),
        CALCULATE ( SUM ( 'Table'[Total tested] ) )
    )
    Measure Pos Percent Of Known Results = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Pos] ) ),
        CALCULATE ( SUM ( 'Table'[Pos] ) )+CALCULATE(SUM('Table'[Neg]))
    )
    Measure Pos Percent of Total Tested = 
    DIVIDE (
        CALCULATE ( SUM ( 'Table'[Pos] ) ),
        CALCULATE ( SUM ( 'Table'[Total tested] ) )
    )

     

    Result:

     

    and here is sample pbix file, please try it.

     

    Regards,

    Lin