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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Disable choice option ...
Power Apps
Answered

Disable choice option if there is x number of items with that choice

(0) ShareShare
ReportReport
Posted on by 36

Hi

 

I have a SharePoint list [fdsfsa] with a choice [Date] column.

The choice column has 5 choice options.

 

In Power Apps I want to disable each choice option which have more than 49 items with that choice option.

 

I can disable one choice [CW4: 24th – 28th January 2022] with the code below.

But if I need to code all the combinations it's gonna be a very long formula.

 

Is there an easier way to do this?

 

 

 

If(
 CountRows(
 Filter(
 fdsfsa,
 Date.Value = "CW4: 24th – 28th January 2022"
 )
 ) > 49,
 Filter(
 Choices([@fdsfsa].Date),
 Value <> "CW4: 24th – 28th January 2022"
 ),
 Choices(fdsfsa.Date)
)

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @FaerchDK 

     

    Please try this

     

    Filter(
     Choices([@fdsfsa].Date),
     Not(
     Value in ( Filter(
     AddColumns(
     GroupBy(
     AddColumns(
     [@fdsfsa],
     "DateValue",
     Date.Value
     ),
     "DateValue",
     "GroupName"
     ),
     "Count",
     CountRows(GroupName)
     ),
     Count > 49
     ).DateValue)
     )
    )

     


    Thanks,
    Stalin - Learn To Illuminate

  • FaerchDK Profile Picture
    36 on at

    Thanks @StalinPonnusamy 

     

    I'm not quite sure on how the formula works. But it works as intended.

  • FaerchDK Profile Picture
    36 on at

    Hi @StalinPonnusamy can you help again with a similar issue?

     

    I need to filter the choice options from the SharePoint list lookup column 'Location'.

    I want to filter based on the following criteria

     

    • Regardles of the checkbox 'chkEmptyLocations'. Filter the string based on three comboxes (cboLocationFilter, cboRowFilter & cboPostitionFilter) 
    • Only if the checkbox 'chkEmptyLocations' is true. Filter out choices if there are other items in the list with that Location, except if the column 'More than one blade' is equal to 1

    SharePoint list: 'Blade Status'

    Choice column: 'Location'

    String column: 'More than one blade'

     

    With the help you gave me for my other issue, I have come up with the code below.

    The only thing missing is to keep the choices where the column 'More than one blade' is equal to 1

     

    Can you help?

     

     

    If(
     chkEmptyLocations.Value = true,
     Filter(
     Choices(
     [@'Blade Status'].Location,
     Trim(cboLocationFilter.Selected.Value & " " & cboRowFilter.Selected.Result & " " & cboPositionFilter.Selected.Position)
     ),
     Not(
     Id in (Filter(
     AddColumns(
     GroupBy(
     AddColumns(
     [@'Blade Status'],
     "LocationID",
     Location.Id
     ),
     "LocationID",
     "GroupName"
     ),
     "Count",
     CountRows(GroupName)
     ),
     Count > 0
     ).LocationValue)
     )
     ),
     Choices(
     [@'Blade Status'].Location,
     Trim(cboLocationFilter.Selected.Value & " " & cboRowFilter.Selected.Result & " " & cboPositionFilter.Selected.Position)
     )
    )

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard