I am collecting a dataset from SQL. This data set is a transaction list with amounts, months, quarter and week number columns, as well as others.
I would like to summarize this collection to display totals by:
- Week
- Month
- Quarter
- Year
I followed this article https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby, but haven't been able to achieve the wanted result.
Here is the code to Collect the underlying data:
ClearCollect(CustomerSales,
FirstN(ShowColumns(SortByColumns(Filter('[dbo].[Invoices]',customerid = customer_id, fiscalyear=2019), "txndate", Ascending),
"totalamount", "fiscalweek", "fiscalmonth"), 24
))I would like to create a SalesbyWeek, SalesbyMonth, etc to be used in a chart visual.