Forum Discussion

GhadaMehrez's avatar
GhadaMehrez
Icon for Helper III rankHelper III
4 years ago

Convert field into percentage

I need to convert field value into percentage but when I choose to show value as a percentage I got all values as 100% which is not right:

 

15 Replies

  • It is best to create a measure and format the measure to the intended type. The screenshot shows you are trying to count the number of values.  Please show an example of your data in the visual and explain what the expected out come should be.

    • GhadaMehrez's avatar
      GhadaMehrez
      Icon for Helper III rankHelper III

      As you see here I have fields related to estimated and booked cost in DKK I want for the up 2 rows to show the numbers in percentage 

       

       

      • jennratten's avatar
        jennratten
        Icon for Super User rankSuper User

        You can open the Power Query editor, go to the column with the values and change the type to percent.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi GhadaMehrez ,

     

    As far as I know , Power BI will convert the data format based on column. According to your screenshot, I think there are two columns in your visual. One column with text data like "Target Guidance(%)", another column with number format data. So if you change the data format as percentage in another column , all data in that column will show as percentage.  

    I think you can try FORMAT() function and SWITCH() to create a measure. Please note that your measure will be in text format due to Power BI doesn't support multiple data format in one column or measure.

     

    Measure = 
    SWITCH(
    MAX('Table'[Column1]),
    "Target Guidance(%)",
    FORMAT(COUNT('Table'[Column2]),"#%"),
    "Acutal Booked Cost(DKK)",
    COUNT('Table'[Column2])
    )

     

     

    Best Regards,
    Rico Zhou

     

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