Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
johnmenx
Frequent Visitor

Converting value to percentage using FORMAT but it converts value to text instead of decimal.

Analysis Metric =
Hi, so due to some technical implementations on the page instead of using field parameters in a table I created a table using Enter Data with 3 valies: Sales, Profit, Achievement. And I am passing the following measure into a table and a line chart, based on slicer selection, it will display either Sales. Profit or Achievement percemt:

IF
(
    SELECTEDVALUE('Sales Analysis Metric'[Metric]) = "Sales",
    [Sales Measure],
    IF(
        SELECTEDVALUE('Sales Analysis Metric'[Metric]) = "Profit",
        [Profit Measure],
        FORMAT([Achievement], "Percent")
    )
)

I have used the FORMAT function to format the achievement % to show in percentage format but this actually converts it into a text value and so it displays fine in table but doesn't display in the line chart. How do I get around this? Setting the whole measure or the specific column to percentage values wont work as it only needs to show in percent format when Achievement is selected in the slicer and rest of the two are normal decimal numbers.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @johnmenx 

 

You can try the Dynamic format strings for measures:

Create dynamic format strings for measures in Power BI Desktop - Power BI | Microsoft Learn

Introducing dynamic format strings for DAX measures - SQLBI

 

Example:

vjingzhanmsft_0-1705651359358.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @johnmenx 

 

You can try the Dynamic format strings for measures:

Create dynamic format strings for measures in Power BI Desktop - Power BI | Microsoft Learn

Introducing dynamic format strings for DAX measures - SQLBI

 

Example:

vjingzhanmsft_0-1705651359358.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Anonymous
Not applicable

Unfortunately thats just how the FORMAT function works. It will always convert the value to text and display it in the specified format. You should be ok if you put the number value on the axis, the line will still show the same trend, and if you still wanted to visibly see a percentage somewhere you can add in the formatted measure anywhere that accepts text values i.e. data labels on the line graph. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.