Forum Discussion

nrenaud's avatar
nrenaud
Helper I
5 years ago
Solved

Designating Value Types in a Measure

Hello! I am using the following measure to display data in a matrix (along with other measures). This measure displays the values I am looking for, however, some of the values are currency, some are ...
  • dedelman_clng's avatar
    5 years ago

    Hi nrenaud  - 

     

    You should be able to use the FORMAT function around your values to get the desired result.  There's a good explanation on how it works here, including some examples: https://dax.guide/format/ 

     

     

    Fmt Measure = SWITCH(SELECTEDVALUE(MType[MType]), 
        "Amount", FORMAT(SUM(Dates[Amount]), "$#,0.00"), 
        "Percent", FORMAT(SUM(Dates[Percent]), "Percent"))

     

    Hope this helps

    David