Hey guys, I need some help, I have a problem....
Here I go...
I have a reimbursement app, where it summarizes based on the type of expense of the users, within them: Food, travel, others and transportation.
However, the user needs to modify an item or the type of expense (food, travel, others or transportation), so how do I update my list on the sharepoint based on a form in the powerapps, without losing the other summaries that are already done?
Hi @Gorilla_8 ,
I also notice that you have this part:
Filter(ExpenseMaster;ID=Dropdown1.Selected.Result)
If you use formula like this:
Filter(....);;Filter(...)
It will return two tables.
While gallery only needs one table.
If you want to filter based on multiple rules, please combine them in one filter function.
Also, I've add this filter rule in my formula, please do not filter again.
Try this:
Filter(
AddColumns(
GroupBy(listname;"userID","sumcost");
"Resumo Alimentação";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Alimentação"); 'Valor do gasto');
"Resumo Transporte";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Transporte"); 'Valor do gasto');
"Resumo Viagem";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Viagem"); 'Valor do gasto');
"Resumo Outros";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Outros"); 'Valor do gasto');
);
ID=Dropdown1.Selected.Result
//I have already filter based on ID
)
Best regards,
Hi @Gorilla_8 ,
Please notice the syntax of GroupBy:
GroupBy(table,"fielname","newfieldname")
You need to enter one fieldname in the second paramater.
userID is my fieldname in my test. In your issue, it seems that your fieldname is ID.
You need to replace with your fieldname.
Try this:
Filter(
AddColumns(
GroupBy(listname;"ID","sumcost");
"Resumo Alimentação";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Alimentação"); 'Valor do gasto');
"Resumo Transporte";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Transporte"); 'Valor do gasto');
"Resumo Viagem";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Viagem"); 'Valor do gasto');
"Resumo Outros";
Sum(Filter(sumcost; 'Tipo de Despesa'.Value="Outros"); 'Valor do gasto');
);
ID=Dropdown1.Selected.Result
//I have already filter based on ID
)
If my formula still has some field names, values are not the name that you use in your issue, please all replace them.
Here's a doc about groupby function for your reference:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby
Best regards,
Hi @v-yutliu-msft Thanks for the help, and I dont get you I have to replace the "sumcost" or not?
yes, I read the documentation...but I dont get very wel...
And keep error going...
I got 'Sum' have invalid arguments
The name is invalid. this identifier is not recognized.
sorry for my ignorance
Hi @Gorilla_8 ,
1)You do not need to replace sumcost, this is the new column that you create by groupby function.
Please read the doc that I give you, the syntax of groupby function:
GroupBy(tablename, "fieldname","newfieldname")
2)You need to check these column names:
'Tipo de Despesa', 'Valor do gasto'
Please replace with the column names that you use.
3)You need to check whether 'Tipo de Despesa' field has these value:
Alimentação,Transporte ,Viagem,Outros
If not, please replace with all the value that you use in 'Tipo de Despesa'.
Many data/ fieldname are the test value that I use. You need to replace with yours, not use totally the same formula.
I think you need to know more about these functions:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-aggregates
I suggest you learn the parameters that the functions need.
Best regards,
User | Count |
---|---|
257 | |
110 | |
97 | |
57 | |
40 |