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
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?
Solved! Go to Solution.
Your solution is great Idrissshatila
Hi, @datadelta
There are two ways to solve the problem at hand:
First, I created a simple dataset:
When not using ABS, my sorting result is as follows:
As you described, your sort relies on a minus sign, which you get in reverse order when you use ABS:
We can change ASC to DESC to get the correct sorting:
In addition, we can create a calculated column with a positive value for the Rating column:
Put column2 into the Table visual:
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.
Hello @datadelta ,
you can use the ABS dax function to remove the negative sign
https://learn.microsoft.com/en-us/dax/abs-function-dax
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:
When not using ABS, my sorting result is as follows:
As you described, your sort relies on a minus sign, which you get in reverse order when you use ABS:
We can change ASC to DESC to get the correct sorting:
In addition, we can create a calculated column with a positive value for the Rating column:
Put column2 into the Table visual:
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.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
115 | |
109 | |
95 | |
58 |
User | Count |
---|---|
175 | |
147 | |
134 | |
105 | |
82 |