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
Anonymous
Not applicable

Sort order problem: DAX formatting convert numbers to strings

Hi all! 

 

I am applying a format in a DAX-expressions. To be more exact, i do several DAX's in a switch statement. See below.

If i sort by these formatted values they are treated as text string, such that the sort order doesn't make sense!

 

I read somewhere, that this is a known issue and should have been fixed in the jun-2017 release. But i can't get it working.

 

Could anyone give some input? 🙂

 

Here's my code:

 

Measure1 =

CALCULATE(SWITCH( TRUE(),

VALUES( 'Metric Selection'[Metric1] ) = "Impressions",format([Impressions],"#,0"),

VALUES( 'Metric Selection'[Metric1] ) = "Clicks", format([Clicks],"#,0"),

...

...

,0),ALL('Measure3date'[measure3date]))

 

 

1 ACCEPTED SOLUTION

Hi T_Fischer,

 

Click Modeling-> change format to Percentage.

Capture.PNG 

 

Regards,

Jimmy Tao

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

Hi T_Fischer ,

 

You may try perdefined format string like below:

FORMAT( 12345.67, "General Number")  
FORMAT( 12345.67, "Currency")  
FORMAT( 12345.67, "Fixed")  
FORMAT( 12345.67, "Standard")  
FORMAT( 12345.67, "Percent")  
FORMAT( 12345.67, "Scientific")  

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy,

 

Thanks a lot for your input.

It looked very promising but unfortunately it still converts numbers to a text string.

 

dax_format_2.JPG

 

 

Br, Torben

Hi T_Fischer,

 

Click Modeling-> change format to Percentage.

Capture.PNG 

 

Regards,

Jimmy Tao

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.