Forum Discussion
lastnn30
3 years agoPost Patron
using substitute () to change 2 values.
Hi I have a column called Gender which has values like M, and F. I want to use Subsitute() to replace M to Male and F to Female. So what I created a New Column and I wrote this dax Gender_full =...
- 3 years ago
lastnn30 You might kick yourself:
Gender Full Column = SUBSTITUTE( SUBSTITUTE([Gender],"M","Male"), "F", "Female" ) - 3 years ago
lastnn30 you can create a mapping table and utilize moving forward
Column = VAR mapping = DATATABLE ( "lookup", STRING, "val", STRING, { { "Male", "M" }, { "M", "M" }, { "F", "F" }, { "Female", "F" } } ) RETURN MAXX ( FILTER ( mapping, [lookup] = CALCULATE ( MAX ( 'Table'[Column1] ) ) ), [val] )
Greg_Deckler
3 years agoCommunity Champion
lastnn30 You might kick yourself:
Gender Full Column =
SUBSTITUTE(
SUBSTITUTE([Gender],"M","Male"),
"F", "Female"
)