Comments on: Power Apps GroupBy and Ungroup Functions + 10 Examples https://www.spguides.com/power-apps-groupby/ Learn SharePoint, Office 365, Nintex, PowerApps, PowerBI etc, SharePoint training and video courses Mon, 06 May 2024 12:35:01 +0000 hourly 1 https://wordpress.org/?v=6.6.2 By: Bhavin https://www.spguides.com/power-apps-groupby/#comments/1079 Wed, 01 May 2024 16:05:14 +0000 https://www.spguides.com/?p=27866#comment-1079 I am working on one of power app where I want to create dashboard. I have created one SharePoint list (DataforCRM) where I have three columns (Hname, HardwareStatus and created (default)

Thank you in advance for your time and comments.

Question : I want to show or reflect the most recent status by showing only the latest HardwareStatus”offline” entries, unless they are followed by an “online” entry. If an “online” entry is created, it should remove the “offline” entry from the gallery.

Gallery 1 : (shows both Online and Offline entries from Sharepoint List)

Gallery 2 : (It should only show Offline for recent or last entry where there is no subsequent Online entry for same HName

To test if there is no delay issue, I have two buttons to test it –
Button 1: “ColHardwareStatus”
Button 2 : “colUniqueHardwareStatus”

Power Apps Strucutre :

CountRows(
Distinct(
Filter(
DataforCRMApp,
HardwareStatus = “Offline” &&
Text(Created,”dd/mm/yyyy”) = Text(Today(),”dd/mm/yyyy”)
),
HName
)

ClearCollect(
colUniqueHardwareStatus,
AddColumns(
GroupBy(
Filter(
colHardwareStatusToday,
HardwareStatus = “Offline” &&
IsEmpty(
Filter(
colHardwareStatusToday, // Ensure to reference the correct collection if changed above
HName = ThisRecord.HName,
HardwareStatus = “Online”,
Created > ThisRecord.Created
)
)
),
HName,
AllEntries
),
LatestStatus, First(SortByColumns(ThisRecord.AllEntries, “Created”, SortOrder.Descending)).HardwareStatus,
LatestDateTime, First(SortByColumns(ThisRecord.AllEntries, “Created”, SortOrder.Descending)).Created
)
);

Timer button added to automate –

// Collect all relevant entries for the day
ClearCollect(
colHardwareStatusToday,
SortByColumns(
Filter(
DataforCRMApp,
Text(Created, “dd/mm/yyyy”) = Text(Today(), “dd/mm/yyyy”) &&
HName Blank() && HName “”,
(HardwareStatus = “Offline” || HardwareStatus = “Online”)
),
“Created”,
SortOrder.Descending
)
);

// Trigger the second timer after collection is updated
//UpdateContext({StartSecondTimer: true});
ClearCollect(
colUniqueHardwareStatus,
AddColumns(
GroupBy(
Filter(
colHardwareStatusToday,
HardwareStatus = “Offline” &&
IsEmpty(
Filter(
colHardwareStatusToday, // Ensure to reference the correct collection if changed above
HName = ThisRecord.HName,
HardwareStatus = “Online”,
Created > ThisRecord.Created
)
)
),
HName,
AllEntries
),
LatestStatus, First(SortByColumns(ThisRecord.AllEntries, “Created”, SortOrder.Descending)).HardwareStatus,
LatestDateTime, First(SortByColumns(ThisRecord.AllEntries, “Created”, SortOrder.Descending)).Created
)
);

]]>
By: Olga Melo https://www.spguides.com/power-apps-groupby/#comments/585 Sat, 18 Dec 2021 20:06:41 +0000 https://www.spguides.com/?p=27866#comment-585 👏👏]]> Thank you for this post! It was exactly what I was looking for 👏👏👏

]]>
By: Dinesh https://www.spguides.com/power-apps-groupby/#comments/583 Thu, 16 Dec 2021 11:21:10 +0000 https://www.spguides.com/?p=27866#comment-583 Hi, can u pls tell me How to group by multi select choice column values

]]>