Forum Discussion

PwrBI01's avatar
PwrBI01
Post Patron
5 years ago
Solved

Different formats in switch function

Hi guys,   I have used a switch function to create the following table:   The switch function I have used is the next one:  IF(HASONEVALUE('T_M_Tabla indicadores económicos'[Medida]);SWIT...
  • Tahreem24's avatar
    5 years ago

    PwrBI01 ,

    Create a meaure with the below DAX:

    MEASURE = IF(HASONEVALUE('T_M_Tabla indicadores económicos'[Medida]);SWITCH(VALUES('T_M_Tabla indicadores económicos'[Medida]);"Variación prev. año";FORMAT([Acumulado dos años previos],"#.### $");"% crecimiento";FORMAT([Acumulado var %],"Percent");"Importe medio";FORMAT([Switch importe medio],"## $");"% Var importe medio";FORMAT([Switch importe medio % var],"Percent");"Variación a fecha";FORMAT([Acumulado var],"#.### $")))

     

    P.S. Just replace the $ sign with Pound sign while writing this dax as per your currency requirement.