Forum Discussion
Anonymous
6 years agoNot applicable
Sort with DAX Function FORMAT
Hello All. Does anyone know when the bug will be fixed for sorting measure values that have the FORMAT() function applied to them?
d_gosbell
6 years agoSuper User
This is not actually a bug. When you call the FORMAT function you are converting the number to a string.
When you sort values like 1,2,4,22 as strings
It will sort as "1","2","22","4" with all the "numbers" that start with the same digit grouped together.
If you can, you need to apply the formatting by setting the format property on the measure.
However this will only work if you have a static format, if you are trying to dynamically change the format based on some sort of logical expression then you should vote for the idea on ideas.powerbi.com to add support for calculation groups to Power BI desktop as this functionality would let the engine apply formatting dynamically without using the FORMAT function.