web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Count the number of ti...
Power Automate
Unanswered

Count the number of times a choice appears in a sharepoint column

(0) ShareShare
ReportReport
Posted on by 691

Hello,
I have a list that looks like this:

s44_0-1645626542590.png

 

 

In a workflow, I would like to count the number of times the choice "Nantes" appears in the "Mardi" column. But I can't do that at all. Can you help me please ? 😞  Thank you in advance !

Categories:
I have the same question (0)
  • StretchFredrik Profile Picture
    3,395 Super User 2025 Season 2 on at

    Hello,

     

    I would run a "Get objects" step to get the SharePoint list data with a filter query to only get the rows im looking for, for example: Mardi eq 'Nantes'

     

    Id then do a expression to get the amount of rows on the output from the step above: @length(body('Get_rows')?['value'])"

     

    Hopefully this is a step in the right direction for you 😊

  • Verified answer
    RobElliott Profile Picture
    10,323 Super User 2025 Season 2 on at

    @s44 I'm sure there are several ways to do this, but the way I would do it is shown below.

    In our list we have 5 choices for Nantes and 3 each for Rheims and Paris:
    0-SP-List.png

     After the trigger, initialize a float variable for each choice:

    1-Flow.png

     

    Next, add a get items action. So that you are not bringing back any empty items adda filter query of Mardi ne null

    2-Flow.png

     

    Add an apply to each and select value from the dynamic content. Next we add a Switch which is a type of Condition that just looks at the answer to one thing. As it's a choice column select Mardi Value (not Mardi) from the dynamic content box.

     

    In a Switch you can have up to 27 "cases", for example Mardi Value equals Rheims. Inside each case box add an increment variable action, select the appropriate variable and set the amount to increment it by to 1:

     

    3-Flow.png

     

    Finally outside of the apply to each add a Compose action for each of the choices/variables and set the input to the variable.

     

    4-Flow.png

     

    The result is shown below. The flow has looped through all the items in the list where there was a choice selected, incremented the appropriate variable by 1 and then displayed the overall result in the Compose action.

     

    5-Result.png

     

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • RobElliott Profile Picture
    10,323 Super User 2025 Season 2 on at

    @StretchFredrik your method means you have to change the flow and run it separately for each of the flow options. My method above avoids that and only needs to run once.

     

    Rob
    Los Gallardos

  • Hii_iii Profile Picture
    691 on at

    Your answer is awesome! Thank you so much !

  • Community Power Platform Member Profile Picture
    on at

    Hi @RobElliott ,

    your answer for this question is great and very helpful. 

    I am working on a similar case, but the numbers have to be counted for each owner (person). Could you please

    guide me how to do it.

     

    Example of the output:

    tn101_0-1653952861098.png

     

     

    Thank you in advance.

     

    Miso101

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard