Hi, I have a data table that is connected to SP list "Cartera1", these data table is filtered by an ID based on a TextInput the user enter, I need to sum the column "saldocapital" from that table and show it in a label, I have tried the next formula but a delegation warning is showed and it is not showing the sum:
Formula used to filter the datatable (These filter is working fine):
Filter(Cartera1;StartsWith(cedulasociado;TextInput2.Text))
Formula used to sum the column "saldocapital"
"Saldo Total: " & Text(Sum(Filter(Cartera1;TextInput2.Text);saldocapital);"[$-en-US]$#,###.00")
The result:
How could I try to get this sum done and how to give currency format to the column in the data table and the label?
Thanks in advance,
Solved! Go to Solution.
Hi @Joan_Zulo
With(
{
_item: Filter(
Cartera1;
StartsWith(
cedulasociado;
TextInput2.Text
)
)
},
Text(Sum(
_item;
saldocapital
);"[$-en-US]$#,###.00")
)
Or (Another Method)
With(
{wCode: Cartera1};
Text(Sum(
Filter(
wCode;
StartsWith(
cedulasociado;
TextInput2.Text
)
);
saldocapital
);"[$-en-US]$#,###.00")
)
Reference:
Hi @Joan_Zulo
The sum is not delegable. Please try the below formula
With({_items: Filter(Cartera1, condition)};
Text(Sum(_items; saldocapital);"[$-en-US]$#,###.00")
)
Hi @Joan_Zulo
With(
{
_item: Filter(
Cartera1;
StartsWith(
cedulasociado;
TextInput2.Text
)
)
},
Text(Sum(
_item;
saldocapital
);"[$-en-US]$#,###.00")
)
Or (Another Method)
With(
{wCode: Cartera1};
Text(Sum(
Filter(
wCode;
StartsWith(
cedulasociado;
TextInput2.Text
)
);
saldocapital
);"[$-en-US]$#,###.00")
)
Reference:
You can simply use this formula
Sum(Filter(<same filter as data table>),Column_Name)
Hello @Joan_Zulo
you can use the sum function. i.e :- Sum(Gallery14.AllItems,ColumnName);
you will get the sum of that particular column from the Database.
Thanks @StalinPonnusamy I tried the first method you proposed and it worked properly.
Thanks @StalinPonnusamy What if I need to compute this sum with some conditions, I mean, there's a column named "categoriafinal" it contains letters (A-B-C-D-E) and I need the sum only when this column is different from A?
How could I include this condition in the first method you proposed?
Thanks,
Hi @Joan_Zulo
Please try this
With(
{
_item: Filter(
Cartera1;
StartsWith(
cedulasociado;
TextInput2.Text
)
)
},
Text(Sum(
Filter(_item; "A-B-C-D-E" in 'categoriafinal');
saldocapital
);"[$-en-US]$#,###.00")
)
@StalinPonnusamy I adjusted the code below with the operator "OR", for some reason is not computing the sum when is "B", the other letters are computing the sum correctly.
With(
{ _item: Filter(
Cartera1;
StartsWith(
cedulasociado;
TextInput2.Text
)
)
};
Text(Sum(
Filter(_item; "B" || "C" || "D" || "E" in categoriafinal);
saldocapital
);"[$-en-US]$#,###.00")
)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
199 | |
48 | |
45 | |
45 | |
38 |
User | Count |
---|---|
284 | |
81 | |
80 | |
80 | |
71 |