Forum Discussion
shere100
7 years agoHelper II
Simple Calculation required
Hi, I need to do some simple percentage calaculation on two columns. Not Started 56 Pass 20 Fail 2 Total Work Items 78 I need to display the percentage of success rate. I....
- 7 years ago
Hi shere100
You may create a measure with COUNTX Function.For example:
Measure 2 = COUNTX ( FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Test Result] = "Pass" ), 'Table'[Test Result] ) / COUNTX ( FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Test Result] = "Not Started" ), 'Table'[Test Result] )Regards,
shere100
7 years agoHelper II
Hi, thanks for the response. I get the following message.
Error Message:
MdxScript(Model) (28, 5) Calculation error in measure 'Test Result 2'[Measure 6]: The function SUMX cannot work with values of type String.
To clarify I need to calculate the sum for a status that has string values. The above message appears when I attempt to run the measure.
v-cherch-msft wrote:Hi shere100
You may try to use ALLSELECTED Function.For example:
Measure = SUMX ( FILTER ( ALLSELECTED ( Table2 ), Table2[Status] = "Pass" ), Table2[Value] ) / SUMX ( FILTER ( ALLSELECTED ( Table2 ), Table2[Status] = "Not Started" ), Table2[Value] )Regards,
shere100
7 years agoHelper II
The formula works for numbers in a column but I need to calculate the sum value of string values in a column.
Please advise.