cancel
Showing results for
Did you mean:

## Join of two Collections with sum up by Id

How would you try to get "D"?

Is there a easy solution by powerapps?

In my case, of course I have not only 2 columns, there are a few more and some differ from shop1 to shop2 , but I want them as "Details" in the main result table as well (special columns of shop 1 are empty for shop 2)...

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support

Hi @PowerDapp2 :

I strongly agree with @gabibalaban .My code is a little bit different from his, used to solve the "=0" problem.

Add a button and set it's OnSelect property to:

``````ClearCollect(
IceCreamAll;
IceCream1;
IceCream2
);
ClearCollect(
collectionD;
ShowColumns(
GroupBy(
IceCreamAll;
"Flavor";
"Group"
);
"Quantity";
Sum(
Group;
Quantity
);
"Min";
If(
CountRows(Group) = 1;
0;
Min(
Group;
Quantity
)
);
"Max";
Max(
Group;
Quantity
)
);
"Flavor";
"Quantity";
"Min";
"Max"
)
)``````

Best Regards,

Bof

3 REPLIES 3
Super User II

I think you can use this formula:

It not solve the problem with min=0 when you have only one flavor record (like choco and pistachio) but you can work on it.

Community Support

Hi @PowerDapp2 :

I strongly agree with @gabibalaban .My code is a little bit different from his, used to solve the "=0" problem.

Add a button and set it's OnSelect property to:

``````ClearCollect(
IceCreamAll;
IceCream1;
IceCream2
);
ClearCollect(
collectionD;
ShowColumns(
GroupBy(
IceCreamAll;
"Flavor";
"Group"
);
"Quantity";
Sum(
Group;
Quantity
);
"Min";
If(
CountRows(Group) = 1;
0;
Min(
Group;
Quantity
)
);
"Max";
Max(
Group;
Quantity
)
);
"Flavor";
"Quantity";
"Min";
"Max"
)
)``````

Best Regards,

Bof

thank you very much for your help!

Announcements

#### Power Apps Community Call

Next call is happening on April 21st at 8a PST.