cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver II
Resolver II

Add columns ; groupby

Hi,

I'm playing around with charts and data manipulation, trying to get better at it.

Formula below is my attempt so far to group my source data by date, then I want to add a column which will be a count of how many items are in each grouped table.

It's the expression for the count I'm struggling with.

Hope that makes sense

ClearCollect(datamanip,AddColumns(GroupBy(colCOntainerInfo,"Contnr_booked","DATA"),"TotalToday",CountIf(colCOntainerInfo,Contnr_booked=Contnr_booked)))

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@PPSA 

First: 

ClearCollect(datamanip,    
    AddColumns(
        GroupBy(
            colCOntainerInfo,
            "Contnr_booked",
            "DATA"
        ),
        "TotalToday",CountRows(DATA)
    )
)

 

Although I do not know your data or what is in each of these, I am going by the description that you said you have Grouped by date, so I am assuming that Contnr_booked is that grouping. 

If so, then there is no filter and count as the DATA element will have all the records associated with that date.  Just use the CountRows and you will have your value.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
Super User III
Super User III

@PPSA 

First: 

ClearCollect(datamanip,    
    AddColumns(
        GroupBy(
            colCOntainerInfo,
            "Contnr_booked",
            "DATA"
        ),
        "TotalToday",CountRows(DATA)
    )
)

 

Although I do not know your data or what is in each of these, I am going by the description that you said you have Grouped by date, so I am assuming that Contnr_booked is that grouping. 

If so, then there is no filter and count as the DATA element will have all the records associated with that date.  Just use the CountRows and you will have your value.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Perfect @RandyHayes .

Think I was over thinking it, had previously used countrows but was trying with something before DATA.

Thank you.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (21,276)