Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 = subsitute(Table1(Gender), "M", "Male"")
But that only change M to Male, how can I write one Dax function to subsitute both M and F at same time.
Thank you very much.
Solved! Go to Solution.
@lastnn30 You might kick yourself:
Gender Full Column =
SUBSTITUTE(
SUBSTITUTE([Gender],"M","Male"),
"F", "Female"
)
@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]
)
@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]
)
@lastnn30 You might kick yourself:
Gender Full Column =
SUBSTITUTE(
SUBSTITUTE([Gender],"M","Male"),
"F", "Female"
)
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!