Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
Please see below requirements,
How can i sorting out rows ,so that matching positive and negative numbers are found and sorted next to each other?
BEFORE | |||
Date | Type | Amount | Result |
9/1/2015 | R | 45 | Y |
13/01/2016 | B | 50 | Y |
13/01/2016 | X | -62 | N |
9/1/2015 | R | -45 | N |
9/1/2015 | BA | 80 | Y |
9/1/2015 | B | -50 | N |
8/2/2005 | X | 62 | Y |
9/1/2015 | BA | -80 | N |
AFTER | |||
Date | Type | Amount | Result |
9/1/2015 | R | 45 | Y |
9/1/2015 | R | -45 | N |
13/01/2016 | B | 50 | Y |
9/1/2015 | B | -50 | N |
13/01/2016 | X | -62 | N |
8/2/2005 | X | 62 | Y |
9/1/2015 | BA | 80 | Y |
9/1/2015 | BA | -80 | N |
Solved! Go to Solution.
Hi @Anonymous
You may add a custom column in query editor and then sort by the custom column.
if [Amount] < 0 then [Amount]*-1 else [Amount]
Regards,
Cherie
You could try creating a new measure which gives Abs(SUM(Table[Amount])), and sort Ascending based on this measure.
Hi Akhil,
thank you so much for your suggestion.Is it possbile i can use the same formula in Power Query (Language M).?
Thanks
Hi @Anonymous
You may add a custom column in query editor and then sort by the custom column.
if [Amount] < 0 then [Amount]*-1 else [Amount]
Regards,
Cherie
Thank you so much Cherie.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |