cancel
Showing results for
Did you mean:
Regular Visitor

## Count items in multiple columns

I'm building an app for keeping track of upkeep.

There will be 8 columns that can have the value of 1, 2, 3, or 4.

I'd like to filter, sort and count the number of a certain value in all 8 columns.

For example:

there may be 4 rows who all have 1 adress linking them lets call it "adress x" .

They are then grouped by the adress linking them. Then I'd like to find all rows that have one or multiple "4"s in the 8 columns. Next I'd like to count the number of "4"s in the group "adress x". Finally I want to sort a list of multiple adress-groups by how many "4"s were found at that adress.

Is it possible? I haven't found what function to even start finding value x in multiple columns and rows.

8 REPLIES 8
Solution Sage

If you're always looking for 4s, the simplest thing to do would be to add a calculated column to your data source that counts the number of fours on the row. If you had that, you could simply filter your gallery in power apps for rows where that value was > 0.

If that's not possible, you could filter the gallery for rows that had a four in any position, something like:

Filter(NumberList, Num1=4 || Num2=4 || Num3 = 4)

If you needed to know how many columns had a 4, you could add a calculated column to the table:

Or, use a variable so that you can look for other numbers besides four, and combine the two into one expression to use for the gallery:

``````AddColumns(
Filter(
NumberList,
Num1 = varNum || Num2 = varNum || Num3 = varNum
),
"NumberCount",
If(
Num1 = varNum,
1,
0
) + If(
Num2 = varNum,
1,
0
) + If(
Num3 = varNum,
1,
0
)
)``````

Regular Visitor

Thank you for your response Mike2500.

In your second paragraf, I'm guessing that "NumberList" is my own table, correct?

It seems like I would have access to inputting a formula column into my datasource. The interface is unguided however and I am unfamiliar with PowerFX. Would you know how the code would look to calculate all "x" in column "a", "b", "c"... etc.?

Solution Sage

Yes, NumberList is the underlying table or sharepoint list.

What is your data source?  Are you using SharePoint, DataVerse, other?

Regular Visitor

I'm using Dataverse within the PowerApps for Teams enviroment

Solution Sage

Ok, so the formula column you can add uses PowerFX, which is really the language used by power apps. So if your table has fields like num1, num2, etc., you can add the following as a formula:

If(num1=4,1,0+ If(num2=4,1,0) ...
Regular Visitor

Trying it, but keep getting an error that it was not possible to create or update the column. Might be a limitation or I'm doing something wrong...

Regular Visitor

Yep,

It's a limitation on dataverse for teams, cant use the function column.

I'll give the other method a go.

Thank you for your help and patience.

Regular Visitor

I did the in App version, but I'm having some trouble getting in the "groupby" function.

I've attached photos. The output is one line per "space" seen by the numbered bold labels. (eg. 101, 3 etc). I want to group them by the adress (eg. Repslag..., Evagat...). But when I try to nest the groupby function I can't seen to find where to put it.

Announcements

#### December 2023 User Group Update: Welcoming New Groups and Upcoming Events

A new month means it's time to celebrate and welcome the new user groups that have joined our community. We are excited to announce that we have more than 8 New Groups, which is no surprise after the amazing Microsoft Power Platform Conference. This month, we are breaking them out by the different community categories. If your group is listed here, give this post a kudo so we can celebrate with you! Don't forget to take a look at the many events happening near you or virtually! It's a great time of year to connect and engage with User Groups both locally and online.   Please Welcome Our NEW User Groups   Power Platform: PowerIT User Group: Nottingham Power Platform User Group: Bergen Power Platform User Group: Danmark Nashville Power Platform User Group Microsoft Ambassador Program y Mujer Latina Technolochicas NCWIT Community Copilot Studio:  Copilot User Group Italia Dynamics365: Dynamics User Group AdriaticDynamic 365 Azerbaijan   December User Group Events   01 Dec 2023 Aprendiendo Desarrollo web, creando mi primer power app y power page. 01 Dec 2023 Q4 Hybrid Philadelphia Dynamics 365 & Power Platform User Group Meeting05 Dec 2023APAC Dynamics 365 FastTrack Bootcamp - BI and Analytics07 Dec 2023Bay Area Power Platform Meetup: Learn, Share, and Connect07 Dec 2023Indiana D365/AX December User Group Meeting07 Dec 2023Dynamics User Group Meeting: Houston09 Dec 2023 December '23 - NEW Power Apps User Group Meeting - Online 12 Dec 2023December Cleveland Power Platform User Group Meeting12 Dec 2023 RW2 Data Stewardship Open Forum Discussion 13 Dec 2023  Black Country Power Platform User Group - December 2023 - West Midlands

Welcome to our November Newsletter, where we highlight the latest news, product releases, upcoming events, and the amazing work of our outstanding Community members. If you're new to the Community, please make sure to follow the latest News & Announcements and check out the Community on LinkedIn as well! It's the best way to stay up-to-date with all the news from across the Power Platform and beyond.        This month's highlights:- - Our most active community members- Microsoft Power Up Program- Microsoft Community Days website - The latest blogs and more                 COMMUNITY HIGHLIGHTS Check out the most active community members of the last month. These hardworking members are posting regularly, answering questions, kudos, and providing top solutions in their communities. We are so thankful for each of you--keep up the great work! If you hope to see your name here next month, just get active! FLMikePstork1Nived_NambiarWarrenBelzSprongYeManishSolankiLaurensMwskinnermlcAgniusExpiscornovuscreativeopinion KatieAUinzil2kHaressh2728hafizsultan242douicmccaughanwoLucas001domliu   Power Up Program Click the image below to discover more about the amazing Microsoft Power Up Program, as Reem Omar, Abbas Godhrawala, Chahine Atallah, Ruby Ruiz Brown, Juan Francisco Sánchez Enciso, Joscelyne Andrade Arévalo, Eric G. and Paulina Pałczyńska share how non-tech professionals can successfully advance into a new career path using Microsoft #PowerPlatform.   To find out more about this amazing initiative, click here to apply for the program and reboot your journey into low-code app development today!     Community Days - Event Website Have you checked out the Community Days website yet? Dedicated to the volunteer community organizers around the world, Community Days is the perfect place to find an event near you or add an event for wider exposure. Many thanks to Thomas Daly, Sharon Weaver, Sedat Tum, Jonathan Weaver, Manpreet Singh, David Leveille, Jason Rivera, Mike Maadarani, Rob Windsor and the team for all their hard work. Anyone can host a Community Day on any topic relevant to our industry, just click the image below to find out more.       EVENT NEWS Power Platform French Summit - Paris/Virtual - 6-7th Dec It's not long now until the Power Platform French Summit, which takes place both virtually and in-person at the Microsoft France conference center in Paris on 6-7th December 2023. If you can't make it in-person, all sessions will also be broadcast on virtual networks for better distribution and accessibility.   There's a fantastic array of speakers, including Jérémy LAPLAINE, Amira Beldjilali, Rémi Chambard, Erika Beaumier, Makenson Frena, Assia Boutera, Elliott Pierret, Clothilde Facon, Gilles Pommier, Marie Aubert, Antoine Herbosa, Chloé Moreau, Raphaël Senis, Rym Ben Hamida, Loïc Cimon, Joséphine Salafia, David Zoonekyndt, Aïcha Charpentier, Henry Jammes, Milene Rochard, Mehdi EL YASSIR, and many more. Click the image below for more information.       LATEST COMMUNITY BLOG ARTICLES Power Apps Community Blog Power Automate Community Blog Copilot Community Blog Power Pages Community Blog

#### Unlocking the Power of Community: A Journey with Featured User Group leaders Geetha Sivasailam and Ben McMann

In the bustling world of technology, two dynamic leaders, Geetha Sivasailam and Ben McMann, have been at the forefront, steering the ship of the Dallas Fort Worth Power Platform User Group since its inception in February 2019. As Practice Lead (Power Platform | Fusion Dev) at Lantern, Geetha brings a wealth of consulting experience, while Ben, a key member of the Studio Leadership team at Lantern, specializes in crafting strategies that leverage Microsoft digital technologies to transform business models.   Empowering Through Community Leadership Geetha and Ben's journey as user group leaders began with a simple yet powerful goal: to create a space where individuals across the DFW area could connect, grow their skills, and add value to their businesses through the Power Platform. The platform, known for its versatility, allows users to achieve more with less code and foster creativity.   The Power of Community Impact Reflecting on their experiences, Geetha and Ben emphasize the profound impact that community engagement has had on both their professional and personal lives. The Power Platform community, they note, is a wellspring of resources and opportunities, fostering continuous learning, skill enhancement, and networking with industry experts and peers.   Favorite Moments and Words of Wisdom The duo's favorite aspect of leading the user group lies in witnessing the transformative projects and innovations community members create with the Power Platform. Their advice to aspiring user group leaders? "Encourage diverse perspectives, maintain an open space for idea-sharing, stay curious, and, most importantly, have fun building a vibrant community."   Building Bridges, Breaking Barriers Geetha and Ben encourage others to step into the realm of user group leadership, citing the rewarding experience of creating and nurturing a community of like-minded individuals. They highlight the chance to influence, impact, and positively guide others, fostering connections that extend beyond mere technology discussions.   Joining a User Group: A Gateway to Growth The leaders stress the importance of joining a user group, emphasizing exposure to diverse perspectives, solutions, and career growth opportunities within the Power Platform community. "Being part of such a group provides a supportive environment for seeking advice, sharing experiences, and navigating challenges."   A Year of Milestones Looking back at the past year, Geetha and Ben express pride in the group's growth and global participation. They recount the enriching experience of meeting members in person at the Microsoft Power Platform conference, showcasing the diverse range of perspectives and guest speakers that enriched the community's overall experience.   Continuous Learning on the Leadership Journey As user group leaders, Geetha and Ben recognize the continuous learning curve, blending interpersonal skills, adaptability, and dedication to foster a vibrant community. They highlight the importance of patience, persistence, and flexibility in achieving group goals, noting the significance of listening to the needs and suggestions of group members.They invite all tech enthusiasts to join the Dallas Fort Worth Power Platform User Group, a thriving hub where the power of community propels individuals to new heights in the dynamic realm of technology.