Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Particular cell to Percentage format

Hi All,

 

Need you help to change a perticular cell to % if the correspondent row is specific text.

 

This is how i have the data.

Expected output is as below

 

 

Whereever column A is Approval then the correspondent cell in the Column B should be in % format rest all to be in number format 

5 Replies

  • Anonymous , That will make you measure as text type meausre

    Create a score measure

    score m=  sum(Table[Score])

     

     

    then try like

    if(Max(Table[Type]) = "Approval"), format([score m],"percent"), , format([score m],"number") )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Amit,

       

      Thanks for sharing, but it is not working 

  • Hi Anonymous ,

    The data type of a column is fixed, it cannot have both percentage and number, so you can only do it in measure, you can directly create a measure.

    Measure =
    IF (
        MAX ( 'Table'[Type] ) = "Approval",
        FORMAT ( SUM ( 'Table'[Score] ), "0%" ),
        MAX ( 'Table'[Score] )
    )
    

    Get the result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Thanks for taking time to respond me. % for approval is summing up. I need to visulaize it as it is.

      Ex: 

      TypeMeasure
      A1
      Approval90%
      B2
      C3
      D4
      E5
      Approval92%
      • v-yanjiang-msft's avatar
        v-yanjiang-msft
        Community Support

        Hi Anonymous ,

        In a visual, the same items are automatically accumulated, if you don't want this, you need to add a new column to distinguish them, for example a index column.

        Best Regards,
        Community Support Team _ kalyj

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.