Forum Discussion

lucadelicio's avatar
lucadelicio
Icon for Impactful Individual rankImpactful Individual
3 years ago

Same Line Chart different Format Euros/Percent not at the same moment

Hi everyone,

i need to show in the same Chart Line two different type of FORMAT of the same measure in Euros or Percent (%) not at the same moment.
If i select some KRI i show the euros (KRI 1, 2 3) if i select the other (5,6,7) i need to format in %.

I try to use a measure with a switch and use the FORMAT function like this but the chart return blank.

Also if i format the measure below it doesn't work.

Some ideas?

THANK YOU IN ADVICE!

KRI Measure =
var _codKri = SELECTEDVALUE(D_KRI[COD_KRI])
RETURN
SWITCH(
            _codKri
            ,"KRI_01", FORMAT([KRI 01 Importo], "Currency")
            ,"KRI_02", FORMAT([KRI 02 Importo], "Currency")
            ,"KRI_03", FORMAT([KRI 03 Importo], "Currency")
            ,"KRI_04", FORMAT(DIVIDE([KRI 04 Importo], [Valore attualizzato contratti], BLANK()), "Percent")
            ,"KRI_05", FORMAT(DIVIDE([KRI 05 Importo], [Valore attualizzato contratti], BLANK()), "Percent")
            ,"KRI_06", FORMAT(DIVIDE([KRI 06 Importo], [Valore attualizzato contratti], BLANK()), "0.00%")
            ,BLANK()
)