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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
datadelta
Helper III
Helper III

Inverted sort showing a negative sign. How do I not display the - sign?

I'm sure this is a dumb question but I have a formula that's working as I need it to sort the numbers from highest to lowest when another column is sorted.  However, since the numbers aren't negatives, how do I not display a negative sign?

 

reverse = (-'rates-1 1'[ratings])
datadelta_0-1724852852385.png

 

1 ACCEPTED SOLUTION

Your solution is great Idrissshatila 

Hi, @datadelta 

There are two ways to solve the problem at hand:
First, I created a simple dataset:

vjianpengmsft_0-1724923553715.png

When not using ABS, my sorting result is as follows:

vjianpengmsft_3-1724924128964.png

 

As you described, your sort relies on a minus sign, which you get in reverse order when you use ABS:

vjianpengmsft_4-1724924163815.png

We can change ASC to DESC to get the correct sorting:

vjianpengmsft_5-1724924229849.png

In addition, we can create a calculated column with a positive value for the Rating column:

vjianpengmsft_6-1724924346824.png

Put column2 into the Table visual:

vjianpengmsft_7-1724924400133.png

In this way, there is no need to modify the sorted DAX expression, only to replace the negative values with the calculated columns with positive values.

I've provided the PBIX file used this time below.

 

 

Best Regards

Jianpeng Li

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

View solution in original post

4 REPLIES 4
Idrissshatila
Super User
Super User

Hello @datadelta ,

 

you can use the ABS dax function to remove the negative sign
https://learn.microsoft.com/en-us/dax/abs-function-dax

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thank you.  When I used the ABS, it removes the inverted sort .

Your solution is great Idrissshatila 

Hi, @datadelta 

There are two ways to solve the problem at hand:
First, I created a simple dataset:

vjianpengmsft_0-1724923553715.png

When not using ABS, my sorting result is as follows:

vjianpengmsft_3-1724924128964.png

 

As you described, your sort relies on a minus sign, which you get in reverse order when you use ABS:

vjianpengmsft_4-1724924163815.png

We can change ASC to DESC to get the correct sorting:

vjianpengmsft_5-1724924229849.png

In addition, we can create a calculated column with a positive value for the Rating column:

vjianpengmsft_6-1724924346824.png

Put column2 into the Table visual:

vjianpengmsft_7-1724924400133.png

In this way, there is no need to modify the sorted DAX expression, only to replace the negative values with the calculated columns with positive values.

I've provided the PBIX file used this time below.

 

 

Best Regards

Jianpeng Li

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

Awesome!!  Thanks. 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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