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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Unable to formated calculated measure as number - text shows as only option

I'm trying to sort a chart by a calculated measure, but it sorts incorrectly.  I believe it's because I'm trying to sort numbers that are stored as text, but it will not allow me to change the data type to a number.  

 

See chart that's sorted incorrectly:

 

Capture2.PNG

 

See calculated measure and the inability to change the data type to number.

 

Capture1.PNG

 

When I click on the text at the top, everything is greyed out except the text option.  

 

I've searched around but have not found any solution that works....can someone please help?  

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks - I just created a new measure without formatting the numbers, sorted it, and hid the column by minimizing width.  This seemed to be the best workaround.  

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

HI @Anonymous,

I'd like to suggest you enter to query editor to remove all specific characters that existed in your numeric fields, then you can format these fields as normal number types.

Replace values (Power Query) 

Regards,

Xiaoxin Sheng

az38
Community Champion
Community Champion

Hi @Anonymous 

of course, as your column contains parenthesyses, it can not be a number - only text

you have to either change format to number look-like or use Sort by column function with column [fees_adjusted] as sort parameter https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thanks @az38 , but I'd still like to show negative numbers with  with parens (###).  I created "Total Adjust 2" as a column as opposed to measure.  I changed "Total Adjust" back to the -# format, so I could sort it correctly.  Is there a way I can hide "Total Adjust" in order to preserve the correct sort and just show "Total Adjust2"?  If not, can you elaborate more on the sort parameter you mentioned may help?

 

Capture3.PNG

az38
Community Champion
Community Champion

@Anonymous 

if you do smth like this you will be able to hide "Total Adjust" from your visual

Безымянный.png

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thanks - I just created a new measure without formatting the numbers, sorted it, and hid the column by minimizing width.  This seemed to be the best workaround.  

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.