Forum Discussion
Francoisvdm
4 years agoNew Member
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 ...
- 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"}) + 0var check1 = CONTAINS('Data',Data[Test Scenario],"Customer Survey")var check2 = CONTAINS('Data',Data[Test Scenario],"Customer Ad-hoc")returnIF(check1 = true(),test - 9,IF(check2 = true(),test - 3,test))appreciate the help, it got me on the right path.
Francoisvdm
4 years agoNew Member
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.
Anonymous
4 years agoNot applicable
No problem! Glad to be helpful 😊