I have sharepoint custom list with 3 columns:-
1) ScoreGreenPoint --> of type number
2) ScoreRedPoint --> of type number
3) ScoreFinalScore --> of type calcualted
and inside the PowerApp i am sorting based on the above calculated column, as follow:-
but the sorting is not working for negative numbers!! because -1 (1 green point - 2 red points) is larger than -5 (5 green point with 10 red point)!! any advice?
Solved! Go to Solution.
On second thoughts now I see how simple the formula is, you could use AddColumns() and do this
SortByColumns(
AddColumns(
Scores,
"SortField"
ScoreGreenPoint-ScoreRedPoint
),
SortField,
Descending
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @johnjohn123 ,
Try to keep away from using SharePoint calculated columns in Power Apps (they will not perform as expected) and do the calculation in Power Apps instead. I would recommend default a number field in SharePoint to the calculation and Patch it with the calculation when anything is changed affecting it.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@WarrenBelzto be honest it is weried that such a straightforward sorting will not work.. so how i can do the calculation inside power app and then sort based on the result?
I tried these formuals:-
SortByColumns(Scores,"ScoreGreenPoint"-"ScoreRedPoint",Descending)
SortByColumns(AddColumns("Scores","ScoreFinalScore",Value(Effect)),"ScoreFinalScore",Descending)
I also created a Label with this formual:-
then i used this formula:-
SortByColumns(Scores,Label2,Descending)
but did not work !
Hi @johnjohn123 ,
I was referring to making the same calculation as the SharePoint calculated column in Power Apps then populating a number field with it (on all records). You would then sort on this column.
What I was pointing out was that there are column type in SharePoint that are really only useful in SharePoint and if referenced in Power Apps cause unwanted hardship. I have done a blog on this if it is useful to you.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@WarrenBelz can you advice more on how i can implement this:-
"making the same calculation as the SharePoint calculated column in Power Apps then populating a number field with it (on all records). You would then sort on this column."
On second thoughts now I see how simple the formula is, you could use AddColumns() and do this
SortByColumns(
AddColumns(
Scores,
"SortField"
ScoreGreenPoint-ScoreRedPoint
),
SortField,
Descending
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
183 | |
51 | |
47 | |
32 | |
32 |
User | Count |
---|---|
266 | |
91 | |
78 | |
68 | |
67 |