cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PPSA
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
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,156)