Hello,
There might be a better way (cause I'm quite fresh with CanvasApps and PowerFX). Here is what I did - I artificially added the column of decision weight and used it for the sorting:
SortByColumns(
AddColumns(
values,
"decisionweight",
If(
IsBlank(decision),
1,
Switch(
decision,
"Pending",
2,
"Rejected",
3,
"Approved",
4
)
)
),
"decisionweight"
)
I hope the direction I took is clear.
Here is my initialization of the collection:
ClearCollect(
values,
{
id: GUID(),
name: "First",
decision: Blank()
},
{
id: GUID(),
name: "Second",
decision: "Approved"
},
{
id: GUID(),
name: "Third",
decision: "Pending"
},
{
id: GUID(),
name: "Fourth",
decision: "Rejected"
},
{
id: GUID(),
name: "Second2",
decision: "Approved"
},
{
id: GUID(),
name: "Third3",
decision: "Pending"
},
{
id: GUID(),
name: "Fourth4",
decision: "Rejected"
}
)
Here is how it sorted the result:
