Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Changing Format of Measure

Does anyone know what causes the comma button to be greyed out in the formatting options? I have tried to change the format of the following measure but it is stuck at the text format.

  • Hi Anonymous ,

     

    The measures when are created take into account the type of data you have so if you are making a sum it will pick up the number, if it's a max of a date column it will pick up a date format.

     

    When you use several formats in a measure then it automatically assumes the format is text, since you are having several different format.

     

    In your case when you add the last step in your switch measure "Invaluid Selection" you are turning the measure into text so the formatting option is turn off.

     

    Work around can be one of two:

    • Use FORMAT on each of the CALCULATE syntax similar to:
      • FORMAT(CALCULATE([P&L USD'000'),"###,### $")
    • Change the "Invalid Selection" by blank() or 0 and then create a new measure  that says invalid selection and place it on a visualization on top of the other so one will be on and the other off depending on the selection.

5 Replies

  • Hi Anonymous ,

     

    The measures when are created take into account the type of data you have so if you are making a sum it will pick up the number, if it's a max of a date column it will pick up a date format.

     

    When you use several formats in a measure then it automatically assumes the format is text, since you are having several different format.

     

    In your case when you add the last step in your switch measure "Invaluid Selection" you are turning the measure into text so the formatting option is turn off.

     

    Work around can be one of two:

    • Use FORMAT on each of the CALCULATE syntax similar to:
      • FORMAT(CALCULATE([P&L USD'000'),"###,### $")
    • Change the "Invalid Selection" by blank() or 0 and then create a new measure  that says invalid selection and place it on a visualization on top of the other so one will be on and the other off depending on the selection.
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi MFelix,

      The fix to the measure works well. Thanks so much for your help!

       

      • NadeemAhamed's avatar
        NadeemAhamed
        Helper V

        MFelix 

         

        I have gone through the above format to apply comma in measures for number.

        But its applying only on first 3 decimal. 

         

        is it possible to apply comma for first after 3 decimal then for all after 2 decimal. 

        EX: 1. 23,000

              2. 2,12,244

              3. 23,23,445

         

        It will be greate if you could able to help me out. 

         

        Thank you in advance.