Forum Discussion

Francoisvdm's avatar
Francoisvdm
New Member
4 years ago
Solved

Calculations on a row returned by Distinct Count

Hoping there is a simple answer on this, but I couldn't find anything in the forums and been scratching my head on this one:   I have a matrix visual with the row field = 'Data'[Test Sceanrio] and ...
  • Francoisvdm's avatar
    4 years ago

    Thanks again - got this syntactically correct now, but  it did not quite do what I wanted. Did a bit more digging and finally came up with the following which works fine.

     

    Volume Tested  =
    var test = CALCULATE(
    DISTINCTCOUNTNOBLANK(Data[Test Case Description]),
    'Data'[Overall Status Description] in {"OK","Errors","In Process"}
    ) + 0
    var check1 = CONTAINS('Data',Data[Test Scenario],"Customer Survey")
    var check2 = CONTAINS('Data',Data[Test Scenario],"Customer Ad-hoc")
    return
    IF(check1 = true(),test - 9,IF(check2 = true(),test - 3,test))
     
     
    appreciate the help, it got me on the right path.