1 Reply Latest reply on Jun 7, 2016 7:50 AM by Simon Runc

    Custom Number Format

    Gabriel Almeida

      Hi everyone,

       

      I have a KPI model with 4 collumns (Date, KPI ID, Value and Goal). I would like to format each KPI Id with custom format ( ex. KPI Id = 20 then format Calculation 1 as percentage, KPI Id = 89 as a number). But i don't want to transform this field into a string. Is it possible?

       

        • 1. Re: Custom Number Format
          Simon Runc

          hi Gabriel,

           

          Hows this for you?

           

          So I've assumed that you ID 20 measures (where you want a %age format) need to multiplied by 100, so it shows the figure as a %age (eg. 0.03 would be shown as 3%)

           

          To handle this I create 2 new calculated fields to represent you 2 measures (ACT and Calculation)

          [KPI Dependent ACT Measure]

          IF [KPI Id] = 20 THEN [ACT]*100

          ELSEIF [KPI Id] = 89 THEN [ACT]

          END

           

          [KPI Dependent Calculation Measure]

          IF [KPI Id] = 20 THEN [Calculation]*100

          ELSEIF [KPI Id] = 89 THEN [Calculation]

          END

           

          I've then created anther calc which only returns a '%' sign if the ID = 20, else NULL (and as Tableau doen't plot nulls we only get a %age sign for ID = 20)

          [KPI Dependent Affix]

          IF [KPI Id] = 20 THEN '%' END

           

          I then use these 2 measures, and also bring in the [KPI Dependent Affix] to the 'labels' tile and arrange the text box as per the below

           

           

          Hope this does the trick, and makes sense (it might not do exactly what you want, but you should be able to extend this logic for your exact requirements)