Forum Discussion
Anonymous
2 years agoNot applicable
How do I convert a columns datatype in DAX?
Hoping this will be easy to answer. I have a table which contains student results. Because of the different types of result that exist (9 to 1, and A to E), the data type has to be a string. ...
- 2 years ago
Can you try the following ? :
Total Grades = SUMX( FILTER(YourTableName, ISNUMBER(VALUE(YourGradeColumn))), IF( ISERROR(VALUE(YourGradeColumn)), 0, VALUE(YourGradeColumn) ) )
Anonymous
2 years agoNot applicable
HI Anonymous,
You can add a filter in your table to exclude the A to E text string, then you can use value function to convert these to numeric before aggregating these values.
formula =
SUMX (
ADDCOLUMNS (
FILTER (
ALLSELECTED ( Table1 ),
NOT ( [Results] IN { "A", "B", "C", "D", "E" } )
),
"Score", VALUE ( Table1[Results] )
),
[Score]
)
Regards,
Xiaoxin Sheng