Forum Discussion

vjnvinod's avatar
vjnvinod
Impactful Individual
7 years ago

measure issue

Hi Team,

 

i am using the below measure for selecting $ and %, if you see the below screenshot, my $ value is formatted in %, is there a way to fix this?

Measure 2 = IF (
    SELECTEDVALUE ( Varianceselection[select]) = "Variance$", [Variance$],([%Variance]))
 

5 Replies

  • TeigeGao's avatar
    TeigeGao
    Solution Sage

    Hi vjnvinod ,

    We will need to use the FORMAT() function to format the result, if we want to display the **%, we can use FORMAT ( ***, "0%" ), if we want to display the $**, we can use the FORMAT ( ***, "$#" ). You can refer to this blog: https://www.tutorialspoint.com/dax_functions/dax_format_function.htm to get a format type list.

    Please refer to the following DAX query:

    Measure =
    IF (
        SELECTEDVALUE ( Table1[Column1] ) = "Variance$",
        FORMAT ( MIN ( Table2[Variance$] ), "$#" ),
        FORMAT ( MIN ( Table2[%Variance] ), "0%" )
    )

    The result will like below:

    Best Regards,

    Teige

    • vjnvinod's avatar
      vjnvinod
      Impactful Individual

      TeigeGao 

       

      tried using the format fucntion before it didn't help, tried the below one as well, i am getting error

       

      see the screenshot

       

      • TeigeGao's avatar
        TeigeGao
        Solution Sage

        There is no need to use MIN() function in your scenario, it is a sample, you can use FOARMAT() directly, by the way, could you please share the pbix file?