cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gelos
Post Patron
Post Patron

Count table one column based on first character

Hi,

I need to count a table columns value based on first character.

Please help me.

Example:

Name is table column name

Name

_____________________

Bala

Buji

Ayush

Anish

Diviya

 

If I want count How many rows start with A in this Column. It will be 2. What is the formula for this logic.

Please help me.

@Mike8 

@WarrenBelz 

@RandyHayes 

@Pstork1 

@v-xiaochen-msft 

@timl 

@BCLS776 

@Nogueira1306 

@v-bofeng-msft 

@gabibalaban 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Gelos ,

 

If the table only contains distinct items then the formula could be:

 

CountRows(
    Filter(
        Budget_Table,
        StartsWith(
            Budget_head,
            Left(
                DataCardValue50.Text,
                1
            )
        )
    )
)

 

 

There would be no delegation warnings since all functions are delegable in Dataverse.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

6 REPLIES 6
gabibalaban
Super User
Super User

@Gelos ,

If we are talking a "reasonable" list dimension (like not more than 500 items), my proposal is:

 

ClearCollect(
    ResultCollection,
    AddColumns( 
        GroupBy(
            AddColumns(
                YourDataSource,
                "NameFirstLetter",
                Left(NameColumn,1)
            ),
            "NameFirstLetter",
            "Result"),
        "CountBasedOnFirstCharacter",
        CountRows(Result)
   )
)

 

 Replace to adapt to your needs in formula: YourDataSource and NameColumn.

The Result Collection will have 3 columns: NameFirstLetter (one letter value), CountBasedOnFirstCharacter, Result (a table with all names starts with NameFirstLetter current value).

 

Hope it helps !

What meant like not more than 500 items

@Gelos ,

500 is the limit of items that you can brought to PowerApps with a call to Sharepoint. Of course, you can change this limit to max. 2000 items, but the app responsiveness will be affected. 

any another method to achieve this. I am using this formula

CountRows(
Filter(
Budget_Table,
Left(Budget_head,1) in Left(
DataCardValue50.Text,
1
)
)
)

But it show delegation warning

 

Then I am using Microsoft data verse CDS Table

@gabibalaban 

v-jefferni
Community Support
Community Support

Hi @Gelos ,

 

If the table only contains distinct items then the formula could be:

 

CountRows(
    Filter(
        Budget_Table,
        StartsWith(
            Budget_head,
            Left(
                DataCardValue50.Text,
                1
            )
        )
    )
)

 

 

There would be no delegation warnings since all functions are delegable in Dataverse.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

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 (1,802)