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 / Dropdown Month name to...
Power Apps
Answered

Dropdown Month name to number conversion

(0) ShareShare
ReportReport
Posted on by 599

HI,

i want to display a SPList value into a gallery based on month and year selection in dropdown.

 

This is my collection,

ClearCollect(collMonths,{ID:1,Name:"Jan"});
Collect(collMonths,{ID:2,Name:"Feb"});
Collect(collMonths,{ID:3,Name:"Mar"});
Collect(collMonths,{ID:4,Name:"Apr"});
Collect(collMonths,{ID:5,Name:"May"});
Collect(collMonths,{ID:6,Name:"Jun"});
Collect(collMonths,{ID:7,Name:"Jul"});
Collect(collMonths,{ID:8,Name:"Aug"});
Collect(collMonths,{ID:9,Name:"Sep"});
Collect(collMonths,{ID:10,Name:"Oct"});
Collect(collMonths,{ID:11,Name:"Nov"});
Collect(collMonths,{ID:12,Name:"Dec"});

ClearCollect(collYears,{ID:1,Name:"2021"});
Collect(collYears,{ID:2,Name:"2022"});
Collect(collYears,{ID:3,Name:"2023"});
Collect(collYears,{ID:4,Name:"2024"});
Collect(collYears,{ID:5,Name:"2025"});

I loaded these collection into a two dropdown for month and year.

 

Now what my problem is i selected a month in dropdown it always return 1 in a month format.

 

This is what am using to get a value in gallery,

FirstN(SortByColumns(AddColumns(GroupBy(Filter(Kudos,Month(CreatedonDate) in Text(Month(Dropdown3.SelectedText.ID)), Year(CreatedonDate) in Dropdown6.Selected.Name),"CreatorName","CreatorEmail","Details"),"Count",CountRows(Details)),"Count",Descending),5)

 

But am getting always 1 in month format.. 

How to get correct month format by selecting dropdown?

 

Thanks,

Dhinesh

 

Categories:
I have the same question (0)
  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    Hi @Dhinesh28R ,

    You can Try like below approach hope that will work.

    Filter(AddColumns(TSMasterData,"MonthColumn",Month(Created),"YearComuln",Year(Created)),MonthColumn = Dropdown1.Selected.MonthColumn,YearComuln = Dropdown1_1.Selected.YearComuln)


    You can change the Code as per your requirement. 
    Th

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay

    Thanks,

  • Dhinesh28R Profile Picture
    599 on at

    Hi @VijayTailor ,

    I my list i dont have a value for Dec ( like 12) in my sharepoint list.

    But when i choose Dec in dropdwon it show data in a gallery.

    How to resolve this issue?

     

    Thanks,

    Dhinesh

  • Vijay Tailor Profile Picture
    2,961 on at

    For this Need, you can Only the Display Month Present in the Sharepoint List Like Below.

    VijayTailor_0-1613630484440.png

    Thanks,

  • Dhinesh28R Profile Picture
    599 on at

    hi @VijayTailor ,

     

    Instead of Jan,Feb i have used in 01, 02 in Dropdown..

    Till now if i have select Dec or 12 it display a message in gallery. But i dont have a data for 12th month in my list.

     

    This is what my problem.

  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Dhinesh28R ,

    Please Explain your requirement. with more details so i can suggest the exact solution for the Same.
    with that you can attach all the code and Screenshots if possible to understand the requirment.

  • Dhinesh28R Profile Picture
    599 on at

    HI @VijayTailor ,

    This my gallery based on my month 02 is selected,

    DhineshSharepoint
    SureshJava

     

    In my sharepoint list i dont have a vales for Dec month.

    But it shows a above gallery when i select a 12 in Dropdown.

     

    FirstN(SortByColumns(AddColumns(GroupBy(Filter(List,Month(CreatedonDate) in Text(Dropdown3.Selected.ID), Year(CreatedonDate) in Dropdown6.Selected.Name),"CreatorName","CreatorEmail","Details"),"Count",CountRows(Details)),"Count",Descending),5)

     

    This formula i used for gallery items.

     

    This is the problem. 

     

    Thanks,

    Dhinesh

     

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard