1 - Create Dynamic Table (Modeling -> New Parameters -> Fields )
Table_Measure_Gender=
{
(".Gender_M_Brasil",NAMEOF('FAT_Table'[.Gender_M_Brasil]), 0),
(".Gender_F_Brasil",NAMEOF('FAT_Table'[.Gender_F_Brasil]), 1),
(".Gender_M_Argentina", NAMEOF('FAT_Table'[.Gender_M_Argentina]), 2),
(".Gender_F_Argentina", NAMEOF('FAT_Table'[.Gender_F_Argentina]), 3)
}
Column_DynamicGroup =
SUBSTITUTE('Table_Measure_Gender'[Table_Measure_Gender],"M_","")
IF(SEARCH("M_",'Table_Measure_Gender'[Table_Measure_Gender],1,0),
SUBSTITUTE('Table_Measure_Gender'[Table_Measure_Gender],"M_",""),
SUBSTITUTE('Table_Measure_Gender'[Table_Measure_Gender],"F_","")
)