Forum Discussion
Calculations on a row returned by Distinct Count
- 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.
Hi Aditya,
Thanks for the quick reply.
Not sure if I am missing something and may have not been that clear in my explanation
I want to test a different field value and decide the calculation based on its value.
I tried the following but get an invalid token syntx error, line 8 offset 1 which is the table field Data[Test Case Description]
If I try to move the IF clause before the Return it flags an invalid token at line 6 offset 19 which is the condition of the IF statement
These are the syntax errors I see which correspond to the line numbers you mentioned
Use 'Data' instead of 'Data
Regards