cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
loopingmurdock
Helper IV
Helper IV

Charts no duplicate and sumup columns

Hey,

 

My first time with charts, so need i bit of a boost.

I have this chart:

loopingmurdock_0-1659210437771.png

I would like to filter the duplicates [Category] and sum up the total [Income] but when i use the distinct i get the first of any.

Thanks

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @loopingmurdock ,

Substitute with your field names

DropColumns(
   AddColumns(
      GroupBy(
         SPListName,
         "Category",
         "Data"
      ),
      "YourFirstField",
      Sum(Data,YourFirstField),
      "YourSecondField",
      Sum(Data,YourSecondField)
   ),
   "Data"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

@loopingmurdock ,

I am trying to work out what you want here - if you want the totals per category

DropColumns(
   AddColumns(
      GroupBy(
         Add_Expensive,
         "Category",
         "Data"
       ),
       "Income",
       Sum(
           Data,
           Income
       ),
       "Purchase",
       Sum(
           Data,
           Purchase
       )
   ),
   "Data"
)

If you simply want the two totals (note this is restricted to records numbers of your Delegation limit - as is the one above)

With(
   {wList: Add_Expensive},
   Table(
      {
         Income: 
         Sum(
            wList,
            Income
         ),
         Purchase: 
         Sum(
            wList,
            Purchase
         )
      }
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @loopingmurdock ,

Substitute with your field names

DropColumns(
   AddColumns(
      GroupBy(
         SPListName,
         "Category",
         "Data"
      ),
      "YourFirstField",
      Sum(Data,YourFirstField),
      "YourSecondField",
      Sum(Data,YourSecondField)
   ),
   "Data"
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Don't get it, the "Data" is the cells? and the field also?

 

the table is ADD_EXP

Categoryincomepurchase
salary1000 
shopping 100
loopingmurdock
Helper IV
Helper IV

Hey, just made little tweak and it works.

AddColumns(
    GroupBy(
        Add_Expensive,
        "Category",
        "test"
    ),
    "YourFirstField",
    Sum(
        Add_Expensive,
        Income
    ),
    "YourSecondField",
    Sum(
        Add_Expensive,
        Purchase
    )
)
loopingmurdock
Helper IV
Helper IV

i get two of each in double

loopingmurdock_0-1659221323218.png

 

@loopingmurdock ,

I am trying to work out what you want here - if you want the totals per category

DropColumns(
   AddColumns(
      GroupBy(
         Add_Expensive,
         "Category",
         "Data"
       ),
       "Income",
       Sum(
           Data,
           Income
       ),
       "Purchase",
       Sum(
           Data,
           Purchase
       )
   ),
   "Data"
)

If you simply want the two totals (note this is restricted to records numbers of your Delegation limit - as is the one above)

With(
   {wList: Add_Expensive},
   Table(
      {
         Income: 
         Sum(
            wList,
            Income
         ),
         Purchase: 
         Sum(
            wList,
            Purchase
         )
      }
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

loopingmurdock
Helper IV
Helper IV

With(
   {wList: Add_Expensive},
   Table(
      {
         Income: 
         Sum(
            wList,
            Income
         ),
         Purchase: 
         Sum(
            wList,
            Purchase
         )
      }
   )
)

perfect, need to read on that function [with], thank you so much

Hi @loopingmurdock ,

In this case I only used it to get rid of the Delegation warning (it does not however remove the Delegation Limit). I have a blog on its use if this interests you.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (2,237)