I was able to accomplish creating a dashboard. It requires a lot of formulas to make it work, but it does work. Note: It is a little 'choppy' when changing the output. Not sure how I could make it smoother.
I used a SharePoint list for my data, so you will need to adapt the formulas to Excel. For this to work you will need to add a column to your data source called Position. Each color has a specific position in the gallery. Position 1 is reserved, so start with Position 2, which should be the top position in the gallery and go down.
In this example:
| Color |
Position |
| Red |
2 |
| Gold |
3 |
| Yellow |
4 |
| Green |
5 |
In your App Onstart, create a collection, I only used the columns needed to create the dashboard. My dashboard is view only, you can't click on anything:
ClearCollect(Jobs, ShowColumns(Filter(TestDashboard, !IsBlank(Title)), "JobFamily", "Title", "Department", "Position"))
On your Dashboard screen you need your header row. I used Text Input fields set to 'View' mode in order to get the rounded corners, I set the radius property to 20.
Next you need 7 vertical galleries. Layout: Title. The Items property for the gallery, Replace the Jobfamily with the correct one for each gallery (i.e. JobFamily = "Analyst", JobFamily = Specialist etc.)
Sort(
Filter(Jobs,
JobFamily = "Administrator" && Department = Dropdown3.Selected.Value), Position, Ascending
)
Set your label to the field containing the Job Title. I added a button behind the label (no border on the label). My button is 6 pixels wider than the label and 2 pixels higher (e.g. Label: X = 150, Y=45, Button: X = 156, Y = 47). Right click the button and in "ReOrder" select 'Send Backwards to position it behind the label)
The Button Fill property is:
If(
!IsBlank(ThisItem.Title) && ThisItem.Position = 2, RGBA(211, 30, 72, 1),
!IsBlank(ThisItem.Title) && ThisItem.Position = 3, RGBA(252, 164, 55, 1),
!IsBlank(ThisItem.Title) && ThisItem.Position = 4, RGBA(255, 207, 30, 1),
!IsBlank(ThisItem.Title) && ThisItem.Position = 5, RGBA(159, 207, 105, 1),
IsBlank(ThisItem.Title), RGBA(0,0,0,0)
)
I don't know what you will be using to change your dashboard items. In this example I am using a dropdown that contains the department names. In the OnChange of the gallery is where the work happens to make the dashboard appear the way you want. what this is doing is counting each JobFamily item for the selected department in the collection. If there is no position for a specific JobFamily and Position(Color), a row will be added to the collection that contains the DepartmentName, JobFamily and a position of '1'. This is how the gallery items appear at the correct level. You need a complete If statement as below for each JobFamily. If there are additional colors other than the ones you showed that are at different levels, you will need to add a CountIf statement to each If statement. It will go above the existing ones and each additional one you add will have a 1 more CountIf(Position =""..........) statement than the one below it.
RemoveIf(Jobs, IsBlank(Title));
If(
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Specialist"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Specialist"), Position = 3) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Specialist"), Position = 4) = 0, ForAll(Sequence(3), Collect(Jobs, { JobFamily: "Specialist", Department: Dropdown3.Selected.Value, Position: 1})),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Specialist"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Specialist"), Position = 3) = 0, ForAll(Sequence(2), Collect(Jobs, { JobFamily: "Specialist", Department: Dropdown3.Selected.Value, Position: 1 })),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Specialist"), Position = 2) = 0, Collect(Jobs, {JobFamily: "Specialist", Department: Dropdown3.Selected.Value, Position: 1})
);
If(
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Manager"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Manager"), Position = 3) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Manager"), Position = 4) = 0, ForAll(Sequence(3), Collect(Jobs, { JobFamily: "Manager", Department: Dropdown3.Selected.Value, Position: 1})),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Manager"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Manager"), Position = 3) = 0, ForAll(Sequence(2), Collect(Jobs, { JobFamily: "Manager", Department: Dropdown3.Selected.Value, Position: 1 })),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Manager"), Position = 2) = 0, Collect(Jobs, {JobFamily: "Manager", Department: Dropdown3.Selected.Value, Position: 1})
);
If(
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Administrator"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Administrator"), Position = 3) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Administrator"), Position = 4) = 0, ForAll(Sequence(3), Collect(Jobs, { JobFamily: "Administrator", Department: Dropdown3.Selected.Value, Position: 1})),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Administrator"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Administrator"), Position = 3) = 0, ForAll(Sequence(2), Collect(Jobs, { JobFamily: "Administrator", Department: Dropdown3.Selected.Value, Position: 1 })),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Administrator"), Position = 2) = 0, Collect(Jobs, {JobFamily: "Administrator", Department: Dropdown3.Selected.Value, Position: 1})
);
If(
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Analyst"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Analyst"), Position = 3) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Analyst"), Position = 4) = 0, ForAll(Sequence(3), Collect(Jobs, { JobFamily: "Analyst", Department: Dropdown3.Selected.Value, Position: 1})),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Analyst"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Analyst"), Position = 3) = 0, ForAll(Sequence(2), Collect(Jobs, { JobFamily: "Analyst", Department: Dropdown3.Selected.Value, Position: 1 })),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Analyst"), Position = 2) = 0, Collect(Jobs, {JobFamily: "Analyst", Department: Dropdown3.Selected.Value, Position: 1})
);
If(
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Coordinator"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Coordinator"), Position = 3) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Coordinator"), Position = 4) = 0, ForAll(Sequence(3), Collect(Jobs, { JobFamily: "Coordinator", Department: Dropdown3.Selected.Value, Position: 1})),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Coordinator"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Coordinator"), Position = 3) = 0, ForAll(Sequence(2), Collect(Jobs, { JobFamily: "Coordinator", Department: Dropdown3.Selected.Value, Position: 1 })),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Coordinator"), Position = 2) = 0, Collect(Jobs, {JobFamily: "Coordinator", Department: Dropdown3.Selected.Value, Position: 1})
);
If(
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Expert"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Expert"), Position = 3) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Expert"), Position = 4) = 0, ForAll(Sequence(3), Collect(Jobs, { JobFamily: "Expert", Department: Dropdown3.Selected.Value, Position: 1})),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Expert"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Expert"), Position = 3) = 0, ForAll(Sequence(2), Collect(Jobs, { JobFamily: "Expert", Department: Dropdown3.Selected.Value, Position: 1 })),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Expert"), Position = 2) = 0, Collect(Jobs, {JobFamily: "Expert", Department: Dropdown3.Selected.Value, Position: 1})
);
If(
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Director"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Director"), Position = 3) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Director"), Position = 4) = 0, ForAll(Sequence(3), Collect(Jobs, { JobFamily: "Director", Department: Dropdown3.Selected.Value, Position: 1})),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Director"), Position = 2) = 0 && CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Director"), Position = 3) = 0, ForAll(Sequence(2), Collect(Jobs, { JobFamily: "Director", Department: Dropdown3.Selected.Value, Position: 1 })),
CountIf(Filter(Jobs, Department = Dropdown3.Selected.Value && JobFamily = "Director"), Position = 2) = 0, Collect(Jobs, {JobFamily: "Director", Department: Dropdown3.Selected.Value, Position: 1})
);